What is "Beis Chaver"?
Rashi: He enters his colleague's house to speak with his wife.
Rashi (from Rosh Hashanah 31a): This is a Nevu'ah that the Shechinah will depart from Yisrael, who are like a quarrelsome wife 1 . Beis Chaver is a house in which Mischaberim (gather) 'colleagues' to Hashem, e.g. the idol that Menasheh erected in the Heichal.
R. Yonah: Even if there are many good friends in his house, the company of an evil wife makes him forget all the pleasantness of their company. They will not console him, due to the quarrels of her tongue and the sadness of her company.
Malbim: It is a house with company of lovers and friends. It is not good to dwell alone! However, one who has a quarrelsome wife, it is not good to dwell in Beis Chaver, for she will quarrel with the friend until they will become enemies, or she will arouse quarrels among them, or disgrace him in front of them.
Rashi (25:24): They did evil, and angered the Shechinah.
Here it says that it is better to dwell on the corner of the roof than in Beis Chaver with a quarrelsome wife. Why does verse 19 say that it is better to dwell in the Midbar than [with] a quarrelsome wife and anger?
R. Yonah (19), Malbim 1 : If he is an angry person, also dwelling on the corner of the roof in the city is not good. He must flee from her to the Midbar. R. Yonah - here we discuss a man with friends - "u'Veis Chaver." They widen his Da'as (so he need not flee so far).
Malbim (19): Above discusses a woman who is not an angry person, just she arouses quarrels with her neighbors and household. He must separate from others, and dwell with her on the corner of the roof, so she will not have anyone to quarrel with. If she is an angry person, she will anger also him, so he must flee from her to the Midbar.