#1: Don't reveal your villains' names.
The spell states (emphasis mine):
When you cast this spell, you can speak the name of a specific creature (a pseudonym, title, or nickname doesn't work).
A villain who is aware of the Gate spell would not tell his name to others. Hence, your players cannot summon him, if they only know him as "evil wizard of the east" or "the hero of Parnast" (yes, that guy is a villain, no further discussion necessary).
It might even be possible for the villain to change his "true name" with a Wish, but that depends on your DM. I'd probably allow it (especially if I'm the one who wants to allow the villain to change his name ^^).
#2: Use Contingency with Otiluke's Resilient Sphere.
You can also cast the Contingency spell on yourself, using "when someone other than me teleports me" as a trigger, and make the spell trigger an Otiluke's Resilient Sphere.
Note that this sphere can be dispelled or destroyed with Disintegrate, so it won't work if your PCs anticipate the use of this sphere.
Whether or not you can teleport or plane shift while inside a Resilient Sphere seems to be not 100% clear. Therefore, I have asked a separate question to resolve the issue.
To address an issue that multiple people have raised in comments: you cannot teleport away with Contingency. Contingency only allows spells up to 5th level to be stored, which leaves only Teleportation Circle as a long-range-teleportation spell. Unfortunately, you have no way of knowing where you might be Gated to, so it would be a very risky gamble to store Teleportation Circle in Contingency - the spell doesn't work across planes.
#3: Have an active Clone residing in an area protected against teleportation and planar travel.
The clone spell allows you to grow an "inert duplicate" of yourself. If / once you die, your soul transfer to this clone, allowing you to "respawn".
If you put your clone on a Demiplane affected by a permanent Forbiddance spell (i.e. you have to cast the spell there 30 days in a row), then you can't be immediately resummoned and killed permanently, either. You don't technically have to put your clone on a Demiplane, but since it's a lot harder to travel to a demiplane and kill your clone than it is to travel to a remote castle on the material plane, I highly recommend using a Demiplane.
Note that Forbiddance may prevent you from traveling to your Demiplane. If you leave a small part of your Demiplane unaffected by Forbiddance, it shouldn't be an issue, though.
#4: Use Wish (duh) to become immune to Gate.
Note that this is up to the DM, but since you are the DM, it shouldn't be an issue. Either way, the Wish spell states as one of its more advanced effects:
You grant up to ten creatures you can see immunity to a single spell or other magical effect for 8 hours. For instance, you could make yourself and all your companions immune to a lich's life drain attack.
You're gonna want this to be permanent, obviously. One could definitely argue whether or not you can make one creature permanently immune to a spell instead of 10 people for 8 hours. However, I personally think it's a valid choice, especially seeing how creatures such as a Helmed Horror also have a permanent immunity to certain spells (albeit none as powerful as Gate).