This has become a very serious issue, and has rendered many otherwise good maps almost unplayable. Yet there's a very simple way to fix this, one that has been incorporated in other games.
Give spawning players a limited amount of time where they're invulnerable. You're not going to spawn camp a team if they can kill you before you get a chance to kill them.
Yea its something that can to be done as part of the design process of the map.
Unfortunately alot of people seem to add the spawns AFTER they have made their map only to find it challenging on where best to place them.
Some options are:-
Terrain set too high to reach by enemies - so place red spawns at an elevated place making that whole area not possible to reach by the enemy e.g. spawning on top of a building that has no ladders or anything to get up there. Only problem then is you can get the opposite where players just stay there the whole match.
Cover for spawning team but not for enemy team - simple enough and can be combined with elevated spawning. Imagine a long corridor and the only cover is right where you spawn.
Slow the enemy down - e.g. a river near spawns. The enemy has to swim across to get anywhere near. Swimming leaves them vulnerable and in the open.
Hide your spawns and spread them out - in larger maps simply spreading multiple spawns across large areas means the team does not all spawn in one place so the enemy doesn't have a clue where people spawn (they might get to know a couple after playing alot but if the spawning is working right then its not the nearest spawn to them, its the furthest away).
Airdrop -spawning from the air gives players choice as to where they want to go in the map. Very difficult to spawn camp when you spawn 1000 ft in the sky. Wingsuits optional or fall into water.
Set your team and enemy team far apart - ok so a guy gets a couple of kills spawn camping but then has to take another 3 minutes to get back to the spawn area - not ideal but something to consider combined with the above options as well.
Spawns in unused map areas - there are areas of your maps that are either dead space or simply not part of the general flow of the map. Enemies can run past a corner 100 times and never check it or never take a small offshoot of a route or dead end. Good place for spawns where there is very little activity once the match is underway.