Admittedly I do not know this to be 100% factual, but, In my experience, player-placed walls do not 100% deter spawning unless they're part of a 'suitable housing' structure. whether this is a bug or not is not clear.
if you really want to stop the spawning, remove the platforms, or fill that void with lava if you want to even deter spawns from events or solar pillars (which ignore all wall restrictions when spawning)...
I know it's not what you've asked about, but, In my testing, these types of farms have nerfed spawn rates... Better spawn rates can be had by creating a farm with a safe box above the killing/spawning floors.
admittedly, these are substantially more work to make, but, the ones pictured are the best rates I can get for 1:invasions/events (hoik/teleporter box for fastest spawn to kill time & standing spot for pumpkin/frost moon bosses)
2: dungeon or underground (more conventional 'enemies run to the center' type farm with item conveyor for collection)
(it cuts off the full picture, you have to click view full)