Hitler got such a light sentence because He had a basically Nazi sympathetic judge(s), is probably the biggest crux of the matter, for one thing. Hitler was likely as much or even more afraid of being deported from Germany back to Austria (which he could well have been — by birth he was technically a ‘foreign national’, albeit a naturalized German citizen, who had served in the German army during WWI, etc).