I am so sorry.
I agree with PASA. He is old enough to make this choice and you can do nothing to change it.
My son is this way.The more I speak, the more he disrespects me and thinks I am out of touch with reality.
There are several things to be grateful for here (leaving aside the elephant in the living room you have not told us about.)
First, your son is super smart. Second, he is competent and capable. He is a self-starter and he does have confidence in himself and his judgment.
Now, of course he can still be stupid and lack judgment. He has proven that, already.
I can imagine the shock and horror of this all for you.
I would give yourself time to recuperate.
Under no circumstances (except if he was facing a very long sentence such as life) would I get an attorney.
From what I have seen in life, he is likely to use any get out of jail card, to pursue the exact same stupidity, as before. He has already told you what his choice is, what are his priorities, his friends, and his lifestyle. Be warned.
No solution will come from anybody but him. This must work itself out. Until he sees the error of his ways...(his friends abandon him, etc.) or he matures, nothing, not one thing, you can do will change any of this.
None of this is your fault. None of it.
I am so sorry this is happening to you. I cannot imagine the pain of believing you dodged a bullet and then to see the blood streaming out of you. That is exactly what it is.
You had believed your son was on the path to maturity, to excellence, and he was falling. Worse than that. He decided and set about to create and expedite a path that could destroy him. You awoke to a nightmare, not a dream.
Please keep posting. I am glad you are here with us. Please find it within yourselves to take care of you.
All of us here, are as if mortally wounded. We deserve care. You will get it here. You deserve it.