Because prosecutors sometimes care more about being seen as tough on crime and not compassionate towards young kids who do stupid things at an age where they're not blessed with an abundance of restraint and good decision making skills?
Because it's cheaper and more fair to set an arbitrary limit and apply it across the board than to try to evaluate each offender's maturity level individually.
It’s just a magic line. 17? No consequences. 18? Full adult.