Long story short, Hitler used the trial as a propaganda tool, and the right-wing judges running it were sympathetic to his cause, if not his direct actions. This, combined with the general fact that left-wing partisans were punished with much heavier sentences than right-wing partisans at the time accounts for why he was punished with only 9 months for treason while Communist agitators from the same period received much longer sentences for much lesser crimes.
Regarding the propaganda, Hitler would defend his actions in a form similar to: If the charge is wanting to overthrow the corrupt government in Berlin and restore Germany to its rightful place among the nations, then I am guilty. If the charge is loving Germany too much, wanting her to become strong again and to cast off the tyranny of Versailles, then I am guilty. And more along those lines.
You have to consider the context as well. This is right after the hyperinflation of '23 and stability in Germany is really non-existent. Further, Hitler was not the person then that he was to become later, so his arguments would not have been stained by the person making them, while pretty much anything associated with the man is tainted today for obvious reasons. In other words, his arguments made at trial would have appealed to a much larger segment of the population than anything associated with Hitler or Nazism would today.
Source: Tom Childers, "A History of Hitler's Empire, 2nd Edition*