Romantic delusions can be expensive:
41% of [US] babies were born to unmarried moms in 2008. … More than half of the unmarried parents were living together at the time their child was born and 30% of them were romantically involved (but living apart). Most of those unwed mothers said their chances of marrying the baby’s father were 50% or greater, but after five years, only 16% of them had done so and only about 20% of the couples were still cohabiting.
These delusions seem obviously functional – people are who more confident in their partners are more attractive as partners. But the cost of such costly signals can be great.
It's not a delusion; it's an accurate perception of existing incentives. Not that the partner will marry her, but that he will be forced to support her for the life of the child, if she conceives. THAT is the problem - although lack of effective male birth control contributes.
Filter this by age and it makes complete sense. The age of these unwed births are pretty darn high compared to typical births. What if waiting for a candidate that will take good care of a child isn't working? What then?
Well, obviously, you should just get a genetic payload out there in the world, because it has a nonzero chance of reproducing. Not great, but better than no kid. So your biology conspires to trick you into thinking any old person who will mate with you is actually a reliable caretaker who will provide for the child. It would be more rational to remove the "reliable caretaker" criterion, but evolution doesn't care whether you remove a criterion in your mind or simply delude yourself into thinking the criterion is fulfilled; you have a child either way.