He knew all the facts and still made a decision that was guaranteed to kill everyone on the planet. So, after they saved the Earth, he should be tried for the crime against humanity (or attempted murder of everyone on the planet).
Not true. He was given advice from hundreds if not thousands of experts. We only saw the point of view of a few NASA employees. It was stated in the movie that the president's lead scientific adviser believed a nuclear blast on the surface would deflect it enough to miss earth.
I'm going to go ahead and assume you are probably fairly prolific in your field if you are the president's adviser.
Furthermore, the president was making a calculated decision that was in the interest of the survival of the species. At the point it was nearly assured the the drilling was going to fail and even worst there was already conflict with the most inexperienced unqualified crew in the history of NASA. Even if the blast only had a 25% chance of working it was better odds than they were currently facing leaving the decision to the crew who at that point had nearly zero chance of completing their mission.
I guess if you think about it... they should have had a fail safe such as the bomb detonating automatically before zero barrier. Remove human error. I guess Hindsight