This hand went off the rails, because you raised the flop. In general there are only 3 reasons to raise on the flop or turn:
1) You want to build the pot, so you can play for stacks on the river
2) You want your opponent to fold
3) Its a wet board and you want to get it all in on the turn to price out draws or take away their implied
odds
You had TPTK with a stack to pot ratio (SPR) of around 9 on a dry board. You are obviously not
bluffing, there are no draws, and its also not a situation, where its default to play for stacks with a one pair hand. So the more normal play is to just call and basically plan on calling him down on any decent runout. However if you do raise, then you have basically decided to play for stacks, and therefore folding is a mistake. You failed to make a plan and have a clear reason for, what you were doing.
As the hand played out I also have to say, that I think, his line look bluffy. When you clicked him back on the flop, he clicked again, which ok he might do that with a nutted hand. That is certainly possible. But why then would he move all in on the turn for 2 times the pot? It was a very dry board, so its not like, he would need to panick about draws. So why would he not give you a better price and get the rest in on the river?
I think, you got owned a little bit here by a fish. When you just called his extra 6c, he figured out, you were not interested in playing for stacks, and then he went for it on the turn. Maybe I am completely wrong about this, and it also does not matter. Because next time you just call his donk bet, and then this weird line of action can not take place