This girl is 18, and in court for drug possession. Obviously, her life isn't going well. She's afraid, so she overcompensates and acts like a complete bitch in court.
So the judge decides he doesn't like being disrespected, and throws his weight around by increasing her fine and giving her jail time. Which will just make her more afraid, more defensive, and more likely to end up back in that courtroom. It's no wonder our society and legal system produce so many repeat offenders with judges like this and a general population like the commenters on the article.
The judge should have given her community service. Interacting with and helping others might do her some good.