It's a bug. In the PC version if you side with imperials you can still buy the house and become thane. There is a quest that goes along with buying the house and consequently becoming thane that one must complete, it cannot be triggured if you go imperial. For consoles, you cannot buy the house...