Just quit spending tax dollars on these pregnancies. Let these people pay their own way for their pregnancies and you will see the problem of illegitimacy significantly reduced. If the government subsidizes something, it will increase; if the government refuses to subsidize something and the costs of it outweigh the "benefits" of it, then it will decrease.
Ah, yes. You get what you pay for.