The government does not order its subjects to refrain from something.
The government does not state its recognition of something which it considers to be true and will act on.
Owning guns, juggling beanbags, smoking cigarettes, flipping off your grandmother, consensually kissing people (outside of covid), complaining about corrupt mayors, reading War and Peace, eating carrots, swearing at random pedestrians, and collecting stamps are all the first kind of legal.
My parents' marriage, my name, my birthday, the Marquis de Lafayette's US citizenship, the current occupation of Joseph Robinette Biden Junior, my eye color, my mother's height, OJ Simpson's innocence of the criminal offense of murder, my right to freedom of worship, and Tara Westover's birthday are all the second kind of legal.
The opposite of the first kind of legal is when something is illegal, aka unlawful, meaning that the government has prohibited it. Most illegal things are things for which the government can punish you.
The opposite of the second kind of legal is when something is extralegal, aka nonlegal, meaning that the government has no opinion on it. The government doesn't 'sanction' it in either sense of the verb.
Robbing banks, hunting peasants for sport, smoking marijuana, malicious untrue defamation that will probably be believed, nonconsensually kissing people, throwing bricks through shop windows, stealing from investors, and poaching are all illegal.
My friend's relationship with her girlfriend, my nickname, Tara Westover's actual birthday, the proposition that I committed a crime four years ago, my religion or lack thereof, the color you temporarily dyed your hair for Halloween, which novel is my favorite, the weakness of Sauruman, my incredible inabilities in the area of jazz dancing, whom I voted for Homecoming Queen, and whether OJ Simpson committed the criminal offense of murder are all nonlegal.
So. When you say that the government legalized same-sex marriage, you mean the second kind of legal. You don't mean the first kind of legal, because the government did that, uh, forever ago, or at the latest 2003 (or 1967 if you're in Merrie England). If you live in 2014 Georgia and you are in a same-sex marriage, the government of Georgia has not declared your marriage illegal. You are not going to be arrested and imprisoned for being in it. The government of Georgia has refused to recognize your marriage; it is nonlegal, not illegal.
Why do I care about this? Two reasons.
First, a marriage can exist and be valid even if the government doesn't recognize it. Two slaves jumping over the broom were in a marriage whether or not their owners deigned to recognize it. Same-sex married couples in 2014 Georgia were married whether or not the government gave them tax benefits. To say that a romantic commitment does not exist, merely because the people we've voted to hold the biggest guns don't happen to agree, is nonsense.
Second, you are being darned insensitive if the government allows your marriage but doesn't afford it special rights and you say that that's basically the same thing as your relationship being criminalized. Until 2003, same-sex sexual intercourse was a crime in much of the United States. As I write this, on 29 May 2023, polygamous marriage is a felony (but not really enforced, thank God, unless you have some problem with being deported). If the government refuses to recognize your marriage as valid for some asinine reason of bigotry, that's an unacceptable indignity which is by right beneath you; but for G-d's sake, you're not being sentenced to the Reading Gaol here. (Lack of legal recognition can result in suffering worse than going to jail for a few years, but that's not automatic.) They're two different things!
And that's why I refer to 'legally recognizing same-sex marriage' when everyone else says 'legalizing same-sex marriage'.