After studying jurisprudence in Munich and Würzburg, Ehard became public prosecutor in the Bavarian Ministry of Justice in 1919. In this office, he was the main prosecutor of Hitler and Ludendorff in 1924, after their failed attempt to overthrow the Bavarian government in 1923. In 1933 he became President of the high court in Munich, a position he held until the end of the war. He sympathised with the "Bavarian People's Party" but was not politically active in those years.