I think he went along with it because Cersei had made a public accusation, because he hated his son, and because someone had to be punished for regicide.
You do not think Tywin could actually believe Tyrion was guilty?
I think that as much as Tywin hated Tyrion, he at least recognized that Tyrion wouldn’t have killed Joffrey in such a way as to be immediately caught.