Assalamualaikum ustaz. Are the good deeds of a husband aren’t considered as long as he doesn’t provide for his family?
Waalaikumussalam wrt. wbt.,
Alhamdulillah, praise and gratitude to Allah SWT for His countless blessings for us all. Praise and salutations to our beloved Prophet Muhammad PBUH, his family, companions, and all those who follow his footsteps until the Final day.
Sustenance lexically means issuing, which is a person providing the expenses for his family. While according to syarak, it is food, clothing and place of residence and others. It is named nafaqah for it is issued or used for such needs. 
In Sunnah, there is a hadith narrated from Mu’awiyah al-Qusyairi RA, where he asked Rasullullah PBUH: “What is the right of the wife of one of us over him?”
أن تُطْعِمَها إذا طَعِمتَ ، وتَكْسوها إذا اكتسَيتَ ، أوِ اكتسَبتَ ، ولا تضربِ الوَجهَ ، ولا تُقَبِّح ، ولا تَهْجُرْ إلَّا في البَيتِ
“That you should give her food when you eat, clothe her when you clothe yourself, do not strike her on the face, do not revile her or separate yourself from her except in the house.” 
Syeikh Wahbah al-Zuhaili stated that the majority of scholars stated that sustenance that is obligated for a wife are seven matters; food, grocery, clothes, house, utensils for her personal hygiene, household items, helper for his wife if the wife usually has a helper. 
Scholars agreed (ijma’) that a husband is obligated to provide sustenance for his wife. Hence, it still applies even if his wife has her own income, wealth or work. The obligation of sustenance is still on the husband. This is based on the statement of Allah SWT:
وَٱلۡوَٰلِدَٰتُ يُرۡضِعۡنَ أَوۡلَٰدَهُنَّ حَوۡلَيۡنِ كَامِلَيۡنِۖ لِمَنۡ أَرَادَ أَن يُتِمَّ ٱلرَّضَاعَةَۚ وَعَلَى ٱلۡمَوۡلُودِ لَهُۥ رِزۡقُهُنَّ وَكِسۡوَتُهُنَّ بِٱلۡمَعۡرُوفِۚ
“Mothers may breastfeed their children two complete years for whoever wishes to complete the nursing [period]. Upon the father is the mothers’ provision and their clothing according to what is acceptable.” 
Ibn Kathir stated in his commentary that it is obligatory for a father to provide sustenance in terms of clothing with the appropriate means which means any clothing that is acceptable according to the norm or others in her country without it being excessive or a burden. It is according to his (father or husband’s) capability when he is at ease or modest and everything that he is used to. 
According to the above verse, scholars state that it is obligatory for a husband to provide sustenance for his wife. Imam al-Haramain Abdul Malik al-Juwaini said:
وَالأَمْرُ بِالشَّيْء نَهْيٌ عَنْ ضِدِّهِ
“A commandment to do something is a prohibition of leaving it.” 
Thus, the commandment for a husband to provide sustenance for his wife when neglected means it is included as a prohibited matter.
In the issue of sustenance, it should be properly understood. The reason is, that sustenance is an important element in marriage and is under the responsibility of the husband for his wife and dependants.
Moreover, neglecting to provide the sustenance of one’s wife and children is considered a sin based on the evidence of a hadith narrated from Abdullah bin ‘Amr bin al-As, where Rasullullah PBUH said:
كَفَى بِالْمَرْءِ إِثْمًا أَنْ يُضَيِّعَ مَنْ يَقُوتُ
“It is enough for a person to be considered sinful, that he neglects those whom he is responsible to sustain.” 
According to the above question, we didn’t find any evidence that could be used to support the statement that a husband’s deeds aren’t accepted if he doesn’t provide sustenance for his dependents.
Rewards for good deeds and sins are two different matters. If a person does something that is rewarded, Allah SWT will reward him. Whereas, if the action of a person results in sin, Allah SWT will record his sin. Among the condition, in which a deed is accepted are that it is done sincerely for Allah SWT and it follows what has been taught by Rasullullah PBUH. If these two conditions are met, Allah SWT will accept the deed.
Hence, if a certain deed is done by a husband who is sincere for Allah and is in line with the sunnah of the Prophet PBUH, then it is included as an accepted deed. While his act of not providing for his wife and children is a sin that should be avoided.
Lastly, we advise the husbands out there to never neglect the obligation of providing for their wives and children. Guide your family responsibly. Recite and reflect on the following supplication:
رَبَّنَا هَبْ لَنَا مِنْ أَزْوَاجِنَا وَذُرِّيَّاتِنَا قُرَّةَ أَعْيُنٍ وَاجْعَلْنَا لِلْمُتَّقِينَ إِمَامًا
“Our Lord, grant us from among our wives and offspring comfort to our eyes and make us an example for the righteous.”
May Allah SWT grant us all understanding. Amin.
 See al-Mu’tamad fi al-Fiqh al-Syafie, 4/274
 Narrated by Abu Dawud (2142), Ibn Majah (1850) and Ahmad (20013)
 See al-Fiqh al-Islam wa Adillatuh, 10/7349
 Surah al-Baqarah: 233
 See Tafsir Ibn Kathir, 1/634
 See Syarh al-Waraqat fi Usul al-Fiqh, pg. 115
 Narrated by Abu Dawud (1692)