Expected Results: Zombie villagers would count toward either the surface or cave monster population control cap depending on where they spawn.
Observed Results: Zombie villagers do not count toward either population control cap, no matter where or how they spawn.
Steps to Reproduce:
Create a spawn testing world with 2 1-chunk platforms in the middle of spawn-proof 9x9 chunk area. Set up one of these platforms as surface and the other as cave.
Set time to midnight and turn off the daylight cycle.
On either platform, collect zombie villagers in either of 3 ways:
Wait for them to spawn naturally, killing other monsters to keep the density caps open.
Spawn villagers with spawn eggs and allow them to be killed by zombies or drowned on normal or hard difficulty.
Spawn zombie villagers directly with spawn eggs.
Kill all other mobs on both platforms, except the zombie villagers.
Move at least 24 blocks away and wait for natural monster spawns.
Eventually, 8 new non-zombie-villager monsters will spawn on each platform (surface and cave).
Related issues
relates to
Comments


In outside discussion, GoldenHelmet and I speculated about whether this behavior might be intentional, perhaps so that monsters would still spawn at night outside a village filled with zombie villagers. That left me wondering whether the density cap could block zombie villagers from spawning, so I tested that and found that it can. It doesn't seem sensible to me that the density cap should block zombie villagers from spawning, but that having spawned they wouldn't contribute to blocking other monsters from spawning, so I'm more convinced now that this is a bug and not intended behavior.

The reason zombie villagers do not count toward the monster population cap is that there is no zombie_villager_v2.json
in the spawn_rules
folder of the vanilla behaviors. This also means they do not count toward the global mob cap since 1.16.0.
In addition to the point Auldrick raised above about allowing monster spawns around abandoned villages, this setup also prevents what would be a too-easy method of spawn-proofing: if zombie villagers blocked monsters, you could just let one zombie into a pen of villagers to spawn-proof all of the cave across an entire density-check area. No collecting and name-tagging monsters would be necessary b/c the villagers can be bred on-site and they automatically have persistence.
The reason zombie villager spawns are still blocked by the cap is that they don't spawn directly, they permute from zombie spawns. So the zombie spawn rules are what apply.

It's been a while since I reviewed this, and I've learned more about how spawning works in the mean time. I now agree with @unknown's analysis that this is probably working as intended. I don't think there's any question that zombie villagers spawned through player actions should not be counted toward density caps. The only question is whether so-called "naturally" spawned zombie villagers (those that transformed with a 1/20 chance from naturally spawned zombies) should be counted.
The problem with doing so is that the only way to count them under the current architecture is to check all the zombie villagers in the density cap volume and only count the "natural" ones. The spawn cycle runs as part of the main game loop, so this would add the maximum possible processing burden, multiplied by the total number of zombie villagers present. So if you count them, it's going to lag the game if the player happens to be near a large collection of zombie villagers, and on a low end mobile device it could make continued play impossible.
But that's only true if a lot of them congregate, so how likely is that? For "naturally" spawned zombie villagers, it's not likely at all because with a 1/20 chance, only a small number would ever be likely to spawn in the density cap volume. But it's the otherwise spawned ones that would get you:
An abandoned village might have a dozen or more zombie villagers residing in it. Anytime a player is in the village, it could make the game very laggy.
A player might design a villager breeder to spawn and store dozens of pre-infected villagers. Pre-infecting them would keep them safe from unplanned zombie or pillager attacks, plus if you wait to cure them after installing them in a trading hall it will induce neighboring villagers to give you discounts. But while the player is in the breeder, the game could again be very laggy.
In the second of these scenarios, Mojang would have no control over how many zombie villagers were present and therefore couldn't do anything to prevent crippling lag. In a multiplayer setting, it would affect everybody and could easily be caused by somebody who didn't even know they were getting too close to the zombie villagers. So I can readily see why Mojang might find it preferable to let a couple of extra monsters spawn than to try and avoid it.
Confirmed on 1.14.20 Hotfix, Windows 10.
If a simple, isolated spawn floor is set up for either surface or cave spawns and the game is allowed to spawn monsters there, it should only be able to spawn 8 mobs before the density cap stops further spawns. However, it turns out that if the spawned mobs include zombie villagers, you can get more than 8 mobs there. If you then kill the zombie villagers and no more of them spawn, the 8-mob limit goes back into effect.for the mobs spawned to replace the zombie villagers.