It means “quick marriage because the bride is pregnant” and that is 100% the origin of the phrase.
Particularly in poorer, rural parts of the USA having a child out of wedlock was incredibly shameful, and the financial burden of a single motherhood was intolerable. So the bride’s family would ensure the man responsible married their daughter … regardless of how he felt about it. Sometimes that meant having a shotgun at the wedding to ensure he didn’t run off.
It was called “Comedian” and it was a fantastic piece of art.