You can spawn them all at a single place, and do one of these commands :
- /tp @e[type=minecraft:entity, r=radius from the command block] ~ ~ ~
- /spreadplayer center 0 maxRadius false @e[type=minecraft:entity, r=radius from the command block]
- /summon Minecraft:entity ~ ~ ~
The first one teleports the entities to a single place whereas the second one spreads them to a surface, determined by the coordinates of a center (x & z) and a radius.