All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
There is no contradiction whatsoever – praise be to Allaah – between the verses that you referred to in the question. Al-Bukhari clarified the meaning of the verse in Surah Al-A’raaf [Quran 7] as he entitled a chapter at the beginning of the Book of Dress as “The Book of Dress and the saying of Allaah {Say, “Who has forbidden the adornment of [i.e. from] Allaah which He has produced for His servants.} [Quran 7:32] and the Prophet also said: ''Eat, drink, wear clothes, and give alms without extravagance and without conceit.” And Ibn ‘Abbaas said: “Eat and drink what you wish and wear what you wish but avoid two things: extravagance and conceit.”
This is evidence that this verse means that it is permissible to enjoy the bounties of this world as long as this does not lead to a prohibition.
On the other hand, extravagancy differs according to the situation of the people. If a rich person wears the best clothes, he is not extravagant but if a poor person wears the same clothes, he would be considered as being extravagant, and so forth. For more benefit on extravagance, please refer to Fataawa 88497 and 82764.
As regards the two verses in Surah Hood [Quran 11:15-16] and the similar verses, they are about those who preferred the life of this world over the life of the Hereafter, as this is dispraised. Allaah Says (what means): {But you prefer the worldly life. While the Hereafter is better and more enduring.} [Quran 87:16-17] The same thing applies to the verse in Surah Al-Ahzaab [Quran 33]; At-Taahir Ibn ‘Ashoor in his book “At-Tahreer wat-Tanweer” said: “The verse {If you should desire the worldly life and its adornment,…} [Quran 33:28] means ‘if you prefer the luxury of this life over being preoccupied with acts of obedience and being ascetic…’”
However, being ascetic in this life is desirable but not an obligation, so whoever wishes to spend abundantly on himself and on his wife and children to enjoy the (permissible) pleasures of this worldly life, he may do so without being extravagant. The evidence is the verse in Surah Al-A’raaf [Quran 7:32] and because this is permissible in general.
Also, the Hadeeth that you mentioned, which is the saying of the Prophet : "…and expand my house for me…” is a Hasan [good] Hadeeth reported by Imaam Ahmad in his “Musnad”. It is evidence for the permissibility of expanding one’s dwelling. This is also supported by what is reported by Ibn Hibbaan from Ismaa’eel Ibn Muhammad Ibn Sa’ad Ibn Abi Waqqaas from his father from his grandfather (Sa’ad Ibn Abi Waqqaas ) who said: “The Prophet said: “Among the things that bring happiness to a believer in this life are four things: a righteous wife, a spacious house. a righteous neighbor and a good steed”. For more benefit, please refer to Fatwa 92273.
Furthermore, some scholars are of the view that a rich person who is thankful (to Allaah) is better than a poor person who is patient, and some of them said the contrary. However, Ibn Taymiyyah stated that the correct opinion in this regard is that the best of them is the one who is the most pious of them.
In addition to this, many Ahaadeeth that discourage building big houses are Dha’eef (weak), and there is a Fatwa issue by the Permanent Committee of Fatwa in Saudi Arabia about the classification of these Ahaadeeth, like the Hadeeth in which the Prophet ordered Al-‘Abbaas to demolish the room which he had built, as this is a Mursal Hadeeth (i.e. narrated by a Tabi’ie (successor of the Prophet’s companions).
As regards the other Saheeh (sound) Ahaadeeth in this regard, like the Hadeeth reported by Al-Bukhari on the authority of Khabbaab who said that the Prophet said: ''Indeed a Muslim is rewarded (in the Hereafter) for whatever he spends except for something that he spends on building." [Al-Bukhari], then some scholars interpreted this Hadeeth to mean what exceeds one’s need or what was spent as a way of ostentation. It is for this reason that Al-Munthiri entitled a chapter in his book “At-Targheeb Wat-Tarheeb” as “The chapter of warning against building in excess of one’s need out of ostentation and piling up of worldly things”. Also, Al-Bayhaqi entitled a chapter in his book “Shua’ab Al-‘Eemaan” as “The chapter of dispraising building palaces and homes that one is not in need of.” Besides, Al-Haafith Ibn Hajar said in “Fat’h Al-Baari”: “This means building what is surplus to one’s need.” It is appropriate here to mention the last part of the statement of the Permanent Committee of Fatwa (in Saudi Arabia) about these Ahaadeeth as it said: “As for these Ahaadeeth and others of the same meaning, then some of them are Saheeh [sound], some of them are Hasan [good] and some others are not authentic, so the Ahaadeeth that are authentic are understood to mean dispraising whoever does so for the purpose of ostentation, extravagance and prodigality, and this differs according to the circumstance, person, place and time…but if the building is high for a valid purpose, like providing services and accommodation for the needy, or taking it as a means of earning one’s living, or that one has many people whom he has to spend on, and the like, then this is permissible in our view, as things (acts) are judged according to their intended goals. The Prophet said: ''Indeed, actions are judged according to their intentions and every person will get the reward of what he has intended.” [Al-Bukhari and Muslim]
With regard to the Hadeeth that you mentioned in the question that the Prophet ordered the Muslims not to build a house containing more than three rooms, we did not come across it. Even if it is authentic, it is understood to mean what we have already explained.
Concerning the supplication of the Prophet : ''O Allaah, keep me alive as a poor man.”, then the authenticity of this Hadeeth is a controversial issue among the scholars of Hadeeth. Some of them classified it as fabricated, or Dha’eef [weak], and some others said it is a Saheeh Hadeeth. If we presume that it is Saheeh, it is desirable for a Muslim to supplicate with it as a way of imitating the Prophet . However, the meaning of this Hadeeth as Al-Mubaarak Poori said in his book “Tuhfatul ‘Ahwathi” is: “i.e. include me among their group, which means make me one of them, but his request does not mean poverty, rather it means humbleness, humility and submissiveness to Allaah.”
Allaah Knows best.