They can’t. But if a 13 year-old girl can give consent to a 12 year-old, she can give consent to a 50 year-old.
Consent is consent.
The other side of it is that a 50 year old should know better.
The assumption is a 12 year old isn’t mature enough to deny their baser instincts.
Exactly. The concept behind statutory rape laws is that a 13-year-old is fundamentally incapable of consenting to sex. As soon as one says, "... except if the other party is (fill in the blank)," then one is contending that a 13-year-old is fundamentally capable of consenting to sex, and all rules other than "not by physical force" can be considered arbitrary restrictions on liberty.
So, what about the mentally handicapped. If two of them date each other, and wind up having sex, do we send them both to jail for being rapists?
So, under the circumstances, I'd have to agree that the judicial ruling was proper.
Carrying the sexual offender label for life is, however, an entirely different matter. A juvenile generally gets far more serious convictions than statutory rape expunged from their records when they reach the age of majority.