This is one of those weird ones, because he's sort of on a semi-bluff, in the sense that he is betting like he has a made hand on the flop, but really doesn't. He's just chasing a flush with the next to nuts king. Not a great play, but it's a play. When the 7 comes on the turn, and considering he is playing pretty loose, I am not at all surprised to see him stay in with a flush draw plus open ended straight draw...
Remember what he is probably thinkings: I have outs galore, right? I mean, all them clubs, the 8 outs to make the straight, plus I could hit a pair with the king... damn, thats 9 + 8 + 3 20 outs! Wow, I gotta bet this one!
He played very poorly but came out on top. At some point, I think everyone learning has donk'ed their way into this position.
I am not sure there is anything you can do in this position that would work any better, except perhaps to really push him harder after the flop, because unless he played 99, 98 or 88 you are pretty much solidly ahead of him at that point. Check raise sounds more like trying to shove you out of the pot, rather than wanting you to play. With only the flush draw and not the straight draw, you might have had more chance at this point to get him to fold.
Then again, his play suggests a cross between a pure lucky donk and a calling station after a red bull. Sort of missing info to know how he was playing in general. You may have been doomed from the get go.