After his guilty plea, he probably shouldn't have joked around with the press about putting the criminal case in his next movie with Cheech Marin. It seems the federal prosecutors and judge felt that showed a lack of remorse. He could gave gotten community service.
He was offered home detention, by the way, but chose to go to jail. The martyr status is probably better for his career.