You’re describing I Am Legend (2007) (Will Smith), not The Last Man on Earth.
In I Am Legend, virologist Robert Neville barricades himself in a fortified Manhattan (not LA) home after an engineered virus wipes out humanity. His wife and daughter die in a chaotic evacuation helicopter crash before the quarantine—not at the door. The “refusing entry” beat may be a conflation with another film (e.g., The Girl with All the Gifts, It Comes at Night).
If the LA setting and wife-at-the-door detail are vivid, it could be a lesser-known indie thriller—share any other details (actor, year, ending) for a precise match.