If one pays close attention to what Tywin says to Tyrion, one can notice, as Theik says in his answer, that he is not opposed to visiting whores, only in doing so publicly. For example, he says
"You will not bring the whore to court."
(I.e. "keep her out of sight".) And
"You're done with whores. The next one I find in your bed, I'll hang."
(I.e. "make sure I don't find her".) And of course, we are familiar with the story of Tysha, the common girl that Tywin "made" into a whore by allowing his soldiers to rape her.
The foreshadowing of Tywin's derogatory view of prostitutes is his father's relationship with a woman who was "a common born woman, daughter of a candlemaker". Lord Tytos was not a strong lord, and this woman took liberties that according to Tywin shamed house Lannister. He therefore upon his father's death punished her by stripping her naked and running her out of town.
"I was made to suffer my father's follies. I will not suffer yours."
-- Tywin to Tyrion
If one pays close attention to an earlier Tyrion chapter, where Tyrion and Varys discuss a hidden entrance to the brothel that Tyrion uses as cover:
[Tyrion:] "How is it a brothel happens to have a secret entrance?"
[Varys:] "The tunnel was dug for another King's Hand, whose honor would not allow him to enter such a house openly. Chataya has closely guarded the knowledge of its existence."
We do not know for sure, of course, but Tywin was Hand of the King for a good long time, during Aerys' reign.
With all this in mind, it does look as though Tywin has a rather warped relationship to prostitutes. He takes every chance to humiliate and punish them in public -- like he whipped Alayaya because he thought Tyrion had slept with her -- while in private, they are his guilty pleasure.
But of course, the only real evidence is that we know he slept with Shae.