Spells such as Regenerate and Heroes' Feast (and probably others that I've missed, too) can heal undead, however I don't think that that's the real answer here.
The first answer is that undead can rest, just like anyone else. Crawford tweeted on this: https://www.sageadvice.eu/2014/09/19/undead-short-rest/ It doesn't mention long rests, but I think it's safe to assume that if they can take short rests, they can take long rests, too. So they have the same option for restoring health as any other non-spellcasting character or creature.
The second answer is that most powerful, sentient undead have a backup plan in case of death. It's often the reason they became an undead in the first place. Vampires, mummy lords, and liches of all kinds all return to life if they are reduced to 0 hit points unless adventurers manage to prevent them.
Many powerful dead have ways of healing themselves on top of this, usually at the expense of others. Vampires and demiliches suck the life out of their victims, and vampires continually regenerate on top of everything else.
So while spells that can heal the undead are indeed in short supply, the simple answer is that most undead don't really need them. Also consider that even if Cure Wounds and other spells like it could heal undead, those are spells that most undead wouldn't have access to anyway.
Yes, a vampire's bite can sometimes effectively deal extra damage due to temporary hit points
Damage to temporary HP still counts as damage
Per this Jeremy Crawford Tweet:
When temporary hit points absorb damage for you, you're still taking damage, just not to your real hit points.
So, when the bite ability says "hit point maximum is reduced by an amount equal to the necrotic damage taken" that means that max HP will be reduced by the amount of damage done regardless of temp HP.
Your example
In your example, your maximum HP is 20. Your current HP will also start at 20 since you have taken no damage before this. You also start with 20 temporary HP from some spell or effect.
Starting condition
Max HP: 20
Curr. HP: 20
Temp. HP: 20
So, you take 5 piercing damage and 10 necrotic damage.
Max HP: 20
Curr. HP: 20
Temp. HP: 20 - 5 (piercing) - 10 (necrotic) = 5
Then, because of the vampire bite, your maximum HP is reduced by 10.
Max HP: 10
Curr. HP: 10
Temp. HP: 5
And because your maximum HP drops below your current HP, your current HP immediately drops with it. This is because current HP can never exceed max HP:
A creature's current hit points (usually just called hit points) can be any number from the creature's hit point maximum down to 0. This number changes frequently as a creature takes damage or receives healing.
In this case then, a **vampire's bite, will do additional damage to your HP because of the HP drain and the fact that you had temporary HP.
Specifically it did:
5 (piercing)
10 (necrotic)
10 (HP drain)
= 25 damage
A creature without temp HP would have taken 15 damage. So, yes a creature with temp HP in this case actually effectively takes more damage than a creature without.
Temporary HP is not affected by HP drain since it is independent of max HP.
Official ruling
Jeremy Crawford has agreed with this interpretation in this tweet:
Q: You are hit by a Specter's Life Drain for 10 damage. You have 8
temporary hit points. Is your Max HP lowered by 2 or by 10?
A: By 10
Note that I have been referring to the HP maximum reduction as "damage". I do not mean damage in the technical sense (eg effects that depend on "you take damage") but in the common sense that you lost HP thus it is effectively damage.
Best Answer
Reduction in maximum hit points (max HP) is essentially 5e's replacement for the energy drains, level drains and negative levels of earlier editions.1 As such, it is not meant to be easily or quickly overcome, so low-level magic does not work. In fact, the 5e demilich's legendary action is called "energy drain" while many undead in 5e (specters, wights, wraiths) have a "life drain" effect similar to the vampire's bite. However, max HP reduction is not exclusive to vampires or the undead in 5e. Players can temporarily cause the same effect with the 6th-level Harm spell and other monsters have similar attacks that do not involve necrotic damage. The other max HP reducing attacks and their respective cures are:
As listed above, the means of restoring max HP are specified in the description of the ability/effect that causes the reduction to max HP. This is almost always powerful magic (i.e., the 5th-level "greater restoration spell or similar magic") or a long rest, the latter particularly for undead (specter, vampire, wight, wraith). However, a DM can interpret "similar magic" or house rule other powerful magic that can immediately restore max HP. For example, the blue slaad's claw and otyugh's bite create diseases that cause max HP reduction, so the 6th-level spell Heal may work since it "ends ... any diseases." Similarly, Heal washes its target in positive energy, so a DM could rule that it restores max HP to characters affected by the "life drain" of undead.