Dispensers respect the hitboxes of fences and walls when using spawn eggs on top of them, but armor stands are placed inside and fall into them.
Related issues
duplicates
Attachments
Comments


The dispenser is not the issue, armor stand itself is the issue. Otherwise the mobs also would be spawned inside of the wall/fence. See MC-155992
Thank you for your report!
However, this issue is a Duplicate of MC-65951.
That ticket has already been resolved, which means this won't be fixed.
If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.
Quick Links:
📓 Issue Guidelines – 💬 Community Support – 📧 Customer Support – 📖 Game Wiki