Stopping bats from spawning in vanilla minecraft--Without killing them
There isn't a tag for being spawned by a spawn egg, but you can give entities your own tags with custom spawn eggs:
/give @s bat_spawn_egg{EntityTag:{Tags:["dontkillmepls"]}}
Now you just need to kill all bats that don't have the "dontkillmepls
" tag. Or, even better, teleport them to y=-65, where they are deleted instantly, without animation and sound.