Most times an 17-year-old dates somebody a year or two younger and everything is fine: nobody cares what they're doing. Parents like the kid, the kids behave well, and nobody is the wiser.
Every now and then, however, mom and dad hate the bozo that's dating little Chris. So they try to stop it, but that doesn't work. So they drag the cops in and demand that somebody "do something" Over the years, more and more laws have been set up to "do something", usually about child predation, not this scenario.
In most of these cases, the cops try to calm things down by trying to de-escalate. But sometimes this does not work, so the Commonwealth's Attorney throws the book at the older partner.
It gets worse when the older kid is 17 because there's a time element to it. You charge them as a 17-year-old, they've got a chance to have it all expunged when they reach adulthood. You charge them as an 18-year-old, the mess just gets bigger. Meanwhile the parents (and perhaps the community) is out for blood.
I was lucky in that no charges were pressed, but parents can get very angry -- like come over to your house and shoot you angry. The law in this case is probably the lesser of two evils. I imagine the way the cops want it to play out is that the DA charges the adult with 57 felonies, the kid gets a lawyer, they strike a deal and reduce them all to a misdemeanor and probabtion with the condition that the dating pair stay apart. Parents are happy, society is happy.
I'm not saying I agree with any of this. It's completely nuts. And you can always run into a true believer DA who really is on a crusade. Quite frankly this erect penis nonsense sounds like that might be what we have here. And that's a freaking scary situation. But most of the time this is just a case of using a hammer to kill a fly that keeps landing on your knee.
Having said all of that, the law is insane and must be fixed. Just wanted to point out that sometimes these things don't look as completely crazy from the inside as they do from the outside.