Now knowing, that you had A9o, here is my analysis of the hand:
Preflop
I would definitely raise this up to isolate the limper, but your size is way to small, especially when you are deep stacked. He is just going to call you in position with whatever, he limped with, and whenever you raise preflop you want to give people a reason to fold. I typically go to 4,5BB against one limper, and if I was to tailor a betsize to this specific spot, I would make it even more.
Flop
I do think, it can be ok to go for a check-raise with top and bottom pair, but given that he just limp-called preflop, I would mainly be C-betting. I think, there is a high risk, this guy just check behind, and now you have severely limited the size of the pot, you can win. Your check-raise idea did work though, and your sizing was reasonable at around 70% pot, as far as I can figure out.
Now he goes for a 3-bet, and this is a very strong action. But I am also going to jam top and bottom, just like you did. He really should not be limp-calling AA, QQ, 99 or AQ, and if he did and hit this perfect flop, then good for him. Its just a cooler, and even if you lose, you still have a lot of chips left.
You ask, if you should just have called his 3-bet, and that is also a possible way to play the hand. But what difference does it really make? You are mainly hoping, that he has some kind of draw, that he is going crazy with. And sure if you just call, maybe he will continue betting on the turn. But maybe he will not, and then you have just given him two free cards to draw out on you.
Besides a player like this is also going to pay you with a draw, if you jam the turn, and on any sort of reasonable runout, you are still going to get stacked, if he has a hand like the one, he had. You are not looking to call his 3-bet and then fold later, because the 2 of clubs hit the turn and changed nothing.
Conclusion
This is just one of those spots, where a recreational player made some ridiculous limp-call preflop with a hand, that should have raised every single time, and then he got lucky and flopped a better two pair than yours. Situations like this will happen in poker, and there is really nothing, you can do to prevent them. So just keep playing solid poker, and in the long run you will absolutely crush a player like this.