Well...
First, if you're asking, it seems you get that quite often. So I would say you're probably letting it happen - of course you're not the only at fault there, but still. If you're turfing near your base at the start of the game, just because you need to turf and not for a specific reason, it's a mistake. Especially if at least one other guy is doing the same, because it's way more important to take the centre or vital areas.
If you rush the centre and you don't die at the first encounter, then you won't let them go easily to your spawn, so it's ok. If you die often from the first encounters, then try to see why.
Anyway, let's say they kinda manage to come to your spawn anyway. As it was said, you're not killable in spawn, so don't rush out of it. The most important thing is to find your lurking opponents. To achieve that, you can use your range (if you have it) to turf and make them turf back, or your subs. Point sensor is obvious, disruptor can pretty much do the same, bombs will make a specific sound if you hit (and there even is a white light giving the direction of the hit), sprinkler can't be ignored, and wall allows you to go out extending your spawn. Only the seeker isn't that good, and the mine is useless. The special can help either finding them or killing them, so you definitely should build it. Know the weapons of your opponents too, it will help to find their hidden place. For instance carbon must come very close, .52 or tentatec will be agressive, while weaker weapons will be more careful.
I definitely recommend doing the above - but if really you want something else, you can try changing your weapon, or your stuff. For instance, with quick respawn, you can aim for an exchange with one of the spawncampers.
If the spawncampers are smart, it's a good strategy and you won't be able to kill everyone from there. They just have to fall back when needed. But most of the time it won't be, so the come back can be leathal. Anyway, if it really happens regularly in your games, try to find why. It can be that you're not taking the vital areas, or you're dying at the worst moments.
For instance if 2 of your mates die, you're in 2v4. If you don't care and just turf an area carelessly, or try to attack one (or even two) opponent(s) without knowing the location of others, you're asking to die, and that helps the other team taking map control and advancing towards your spawn. While if you're watching the counts, you just think "2v4 uh, I'll stay quiet, try to know where everyone is, and only kill if it's safe, waiting for my mates", possibly making them jump. The difference is huge, and taking this kind of decisions will build victories.
Hope it helps.