But when he heard of your difficulties, he didn't want you to be wronged (because you two had sex), so he had to say that he was in a bad mood and a little mean and slowly looked for a house.
From his heart at the moment, he is very contradictory; On the one hand, he doesn't want his girlfriend to know or misunderstand your's relationship; On the other hand, he doesn't want you to be wronged for this. After all, you had an affair.
I hope the above answer can dispel your doubts!