This is actually caused by a bug, because marill and azurill normally spawn with different gender rates, Female azurill get a reroll on their gender probability and might end up as a different gender altogether.
But in the end nobody cares about gender as long as you have a ditto