President Johnson believed the Tenure of Office Act to be unconstitutional because it infringed upon the power of the executive, which was himself at the time.
Johnson was already bitter because he had vetoed the bill only to have Congress override his veto. The Tenure of Office Act said that any official that required Senate confirmation could not be removed without the consent of the Senate. The president could suspend an official while the Senate was not in session but could not remove him. The law did not state, however, that a cabinet official appointed by a previous president had to be removed in this fashion.
Since Johnson didn't agree with the Act, he removed Secretary of War Edwin Stanton without Senate confirmation. Congress didn't like that Johnson was doing as he pleased, so he was impeached in the House of Representatives. He narrowly avoided being removed from office by one vote in the Senate.