Mr. Thwackum is Tom and Mr. Blifil's tutor when they are boys. He is also a clergyman working at a parish on Squire Allworthy's lands. Mr. Thwackum believes that the only way to be a good person is to accept the gospel of Christianity without any question. But he does not believe that, to be a decent Christian, you have to do good deeds. He thinks that belief is much more important than behavior.
So he sees no contradiction in the fact that he is a supposedly good Christian, but he also regularly beats the tar out of Tom while Tom is his student. (You'll notice that the name "Thwackum" contains the word "thwack," which means "hit." Fielding isn't exactly being subtle about his characterization of Mr. Thwackum as a vicious, punch-happy jerk.)
Mr. Thwackum supports saintly-seeming Mr. Blifil and hates Tom for his pranks and jokes. So Mr. Thwackum jumps at every chance to beat Tom with a birch rod. When Tom refuses to say who was hunting with him on Squire Western's land, Mr. Thwackum beats him so badly that Squire Allworthy finally jumps in to stop him before Tom gets permanently injured.
Needless to say, we don't think Tom actually learns much from Mr. Thwackum's heavy-handed "education," since Mr. Thwackum is so convinced that Tom is a useless rascal. And all that Mr. Blifil appears to learn from his time as Mr. Thwackum's student is how easy it is to trick a single-minded man into thinking you agree with him.
The problem with Mr. Thwackum (besides his love of violence) is that he is so absolutely convinced of his own rightness that he literally cannot see when he is being foolish and unjust. He loses Squire Allworthy's support permanently when he writes him a letter (in Book 18, Chapter 4) demanding another preaching position in addition to his current one. He is so high-handed and insulting in his manner that the squire finally turns against him (about time! Honestly, we can't believe it took Squire Allworthy so long, when Mr. Thwackum used to beat his ward. We know that it used to be more common back then for kids to be punished physically, but still.)
We'll give Mr. Thwackum credit for one thing: unlike most of the villains in this book, he is not a hypocrite. He is an abusive bully out of genuine conviction that it's the right thing to do. When Mr. Blifil encourages Mr. Thwackum to join him in pulling Tom out of the bushes where Tom is gettin' it on with Molly Seagrim, the narrator comments that Mr. Thwackum is "not only strictly chaste in his own person; but a great enemy of the opposite vice in all others" (5.11.10).
Still, while it may be good that Mr. Thwackum doesn't lie about being a creep, in a weird way, Mr. Thwackum's personal willingness to live as strict and spare a life as he demands from everyone else is only further proof of how much Fielding disapproves of him. After all, Tom's unrestrained sexuality is also a sign of his good, generous nature. Mr. Thwackum's cold self-discipline is just an extension of his overall hatred of all human pleasures and joys.