"Contempt of Congress" does not extend, in a legal sense, to insulting Congress as a whole, one house, a committee chair, or a member. (Congress and its committees have power to require both members and witnesses to abide by its rules of decorum, which forbid such insults, but as far as I know the remedy is merely to remove the disorderly person.)
Contempt of congress is defined by 2 USC 192, which provides that:
Every person who having been summoned as a witness by the authority of either House of Congress to give testimony or to produce papers upon any matter under inquiry before either House, or any joint committee established by a joint or concurrent resolution of the two Houses of Congress, or any committee of either House of Congress, willfully makes default, or who, having appeared, refuses to answer any question pertinent to the question under inquiry, shall be deemed guilty of a misdemeanor, punishable by a fine of not more than $1,000 nor less than $100 and imprisonment in a common jail for not less than one month nor more than twelve months.
Note that this is a Federal criminal statute like any other, and Congress does not normally "declare" a person guilty, much less "apply the imprisonment penalty". Charges would have to be brought before a federal court, and the person convicted by a jury, or by a judge if a jury trial was waived.
Congress does have the "inherent power" to hold trials for contempt itself, but this has not been done since 1934. This power was upheld by the Supreme Cout in Anderson v. Dunn 19 U.S. 204 (1821)
A conviction under 2 USC 192 for refusal to answer questions on the part of a witness under subpoena was upheld against a First Amendment challenge in Wilkinson v. United States, 365 U.S. 399 (1961) In that case, according to the Wikipedia article, a standard for testing subpoenas was declared by the US Supreme court:
As announced in Wilkinson v. United States, a Congressional committee must meet three requirements for its subpoenas to be "legally sufficient." First, the committee's investigation of the broad subject area must be authorized by its chamber; second, the investigation must pursue "a valid legislative purpose" but does not need to involve legislation and does not need to specify the ultimate intent of Congress; and third, the specific inquiries must be pertinent to the subject matter area that has been authorized for investigation.
Thus, in considering such charges, it is a proper defense that the subject matter of the hearing was not withing the power of Congress to investigate, or that the questions were not relevant to the subject. The court would consider these issues if they were raised by the defense. But the political "merits" of the investigation -- whether it is a wise use of the Congressional power, would not be considered.