I think the scene between Jon and Theon was meant to foreshadow Jon's own future identity crisis. He'll be in Theon's position sooner rather than later. He'll have to come to terms with the fact that he's both a Stark AND a Targaryen. Will he be able to forgive himself for the mistakes he's made the way he forgave Theon's? Will he forgive himself for falling in love and sleeping with his aunt? Will he forgive the man he knew as father and is now dead for hiding the truth? Also, the scene was meant to move Theon's redemption arc forward. He needed someone with Jon's courage and integrity to give him the final push. When it comes to bending the knee, I think he did it for a number of reasons. He might have started considering it after Tormund told him that, had Mance Rayder bent the knee, thousands of lives would have been saved. Jon knows what Dany and her dragons are capable of doing, and that the North doesn't stand a chance against them. He also did it because he owed Dany a debt of gratitude. She could have let them die beyond the wall, but she didn't and she lost a dragon as a consequence. And he also did it because he's in love with and in awe of her. I really don't think his decision was based on lust or out of character all things considered. He's always put everyone and everything before himself and, even though he must have known that his bannermen would not be happy and might even want to kill him, he did it anyway because he thought it was the right thing to do.