Did he really emphasise he wanted a male heir, or is it just the media sensationalising it? Apparently only the title (which is nearly always unreliable) and abstract says he's spending that much for a male heir. The content which directly quoted him multiple times never mentioned genders as well, only the number of kids.
I don't understand his logic anyway. Kings always have mistresses... and he's disposing his wives systemically only to name another "unproven" woman as a queen. That woman too, would be disposed off if she failed to produce. In that case why not just hang out around all of his mistresses and just dispose that one single queen after a certain mistress gave birth to a son.