How can dating a minor be illegal whilst marrying one be legal?

I’m talking about when you’re an adult and at least four years older and you’re in a state that allows child marriage. Many USA states allow child marriage, apart from New York, Rhode Island, Pennsylvania, Delaware, Minnesota, New Jersey, and Massachusetts. I don’t understand how in another state, let’s say, sweet home Alabama, it would be illegal to get a minor boyfriend/girlfriend/enbyfriend, but not for marriage. Would they fine/arrest/execute y’all for loving?

In other countries, I don’t know. I’ve moved out of the damn Yankeeland a year ago.

How can dating a minor be illegal whilst marrying one be legal?
Post Opinion