If both of these are true:
1. Players can gain access and/or shoot into the spawn.
2. The server is running an endless gamemode, where there's no objective or resetting for new rounds.
Then that's an issue of it's own.
You can either cleverly design the map so that spawn killing cannot be so predictable.
Or you can introduce an objective so that not only is the onslaught not infinite, but there's an incentive elsewhere on the map, like a flag, a control point, or something else.
Spawn kill prevention is just a bandaid. Instead of getting killed inside the spawn, they'll get killed just outside of it.