I agree with @submariner‘s explanation. I have heard these terms used primarily among African-Americans, and it is due to the fact that the mother is not married to the father. It seems like a shorthand for “my baby’s mama” or “my baby’s daddy.” They contract to “baby mama” and “baby daddy.”
Since you’re not married, you can’t say “my wife” or “my husband.” Boyfriend and girlfriend seem inadequate terms. You want to talk about the specific relationship that holds you together and it is that you created a child together. Since you did create a child, but you aren’t married, there are certain expectations you have about help in caring for the child, but without the expectations about help in creating and maintaining a home.
I hear that a lot in the city (Philadelphia), which is a nearly majority African-American city. The number of unmarried couples having children is higher in the city, I suspect. However, teen pregnancies are down. So a lot of this is happening among people in their twenties and older, now. It is no longer something that can be attributed to ignorance so much, but a kind of deliberate choice.
As with most things African-American, it gets picked up by the larger culture. So the terminology is all over now (if I have heard about it). I suspect (but don’t know) that it means there is greater acceptance of unmarried pregnancies, and that men are having more to do with children they have with women they are not married to. This last is a shaky speculation, and may be more wishful than anything else, but I hope it is true.