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.
Some States effectively clear the record at the age of maturity.
I would think that everything should be discarded when they turn 18.