Hypocrisy is applying contradictory principles depending on the situation.
See also: Motivated Reasoning.