This may be the 2006 film, Right At Your Door.
After Lexi leaves home to visit Central LA, there's a terrorist attack involving chemical bombs. After the attack, her musician husband, Brad, fails to find her and reluctantly seals himself inside his house. He will have to deal with this decision in the days to come.
I recognized the plot from your description. He's already sealed up the house by the time she arrives, and indeed, she shelters on the porch. And yes, he gets his comeuppance, as described in the Wikipedia article.
The next couple of hours are spent with Brad and Lexi on their respective sides of the door, who talk about what they will do assuming they survive. Brad imagines that after this they will both probably end up on one of those morning talk shows where everyone goes to reveal their woes. Suddenly, soldiers appear and grab Lexi, and prevent Brad from coming outside. One soldier manages to calm Brad down and explains to him that because he did such a good job sealing up the house, there is no new air to circulate through, but also explains that, unfortunately, when Lexi broke the door window, the virus was brought inside and has now multiplied to lethal levels, making the air inside extremely dangerous. Brad doesn't understand what the soldier is saying and insists that they bring his wife back. A large heavy piece of plywood is put over the back door, completely covering it. A hole is drilled through the wood and a pipe appears through which a gas starts to be pumped in. More boards seal the windows and doors but Brad manages to break down the plywood covering his front door, only to discover that a fumigation tent has been erected over the whole house. He tries to tear through the tent and is knocked unconscious by a soldier, as Lexi screams Brad's name. The camera cuts to Brad as he takes his last few breaths.