(((((hugs)))))
I am sorry that legal trouble is his current situation. As MWM says, it is unlikely to be only pot and alcohol. I hope and pray that you can learn to deal with your codependence and detach so that your life is not always dependent on his choices. You have worked very hard to raise him with love, good values, good morals, and a good head on his shoulders. You have done what you can, and now? It is time for him to start having to handle the consequences of his choices with no one to shield him. The more you shield him from these consequences, the longer it will take for him to learn that he has to follow the rules of life.
PLEASE get yourself to some 12 step meetings. AlAnon or NarcAnon family meetings would be immensely helpful to you AND to him. If you get help, his chances of recovery are 30% better. I know you did everything possible to get him to graduate. If you spending an hour a day on homework was needed, you did it, didn't you? Think of Alanon as that homework, or the drive to the good school, or the teacher meetings. If it raised his grade from a 60% - a D - to a 90% - an A - you would have done it. By going to these meetings and really working the steps, you can help him with LIFE, which is a lot better than high school grades. don't do one meeting a week. Go to as many meetings in different places & at different times as possible. In the first month the goal should be 30 in 30 - 30 meetings in 30 days. Each meeting time in each location has a different feel and dynamic, and by going to as many different ones as possible, you will find the ones that are the best fit for you. Then continue to go to those meetings that fit you fairly well, and work those steps, and over time you will find that your life will improve. You will also find that you place the responsibility for his actions on hsi shoulders and you BOTH will have much better, healthier lives. YOu may not like his choices, but you will understand at least a bit why you have to let him make them and then you must let him be the one to deal with the consequences - good or bad.
All you can do is love him, and let him cope with his own problems so that he will grow and learn to overcome his problems. Only support those choices that take him to treatment and positive choices. Learn what enabling is and how to not do it, hard as that is. And it IS hard, but it is also crucial.
I am sorry he is causing you such pain, and I hope and pray that in time things will turn around.
(((((hugs)))))