My husband is having erectile dysfunction! Why?

Ask him. Ask him what he thinks and discuss it in a supportive way. Let him know u are still attracted and that u don't want him to be embarrassed or stressed about it. Reaffirm that other sexual activity is pleasurable & that despite his performance issue u still want to be intimate. If he is older or on medication but is able to try ED meds, they are often helpful. Either way he should see PCP. Try toys.
Many possibilities. You didn't mention age, medical history, medications or lifestyle. But in general, erectile dysfunction is more common as we age, possibly due to ravages of time & poor lifestyle, eg smoking, excess alcohol, etc. Obesity, diabetes, high cholesterol, high blood pressure, depression, etc can all cause ed. So can medications used to treat many conditions. Low testosterone might have a role. Go see md.