In Resident Evil (2002), why are the Umbrella Commandos sent in to investigate the Hive shutdown, anti-Umbrella Activist Matt, and the Umbrella operatives/guards Spence and Alice, not affected by the t-Virus in the air?
The Red Queen used the halon fire-suppression system to prevent the further spread of the virus. As a secondary effect, this, along with her ability to control the air-conditioning and air-filtration systems are likely to have resulted in the atmosphere becoming hostile to the virus which (the accompanying novel notes) had been previously housed in a carefully climate-controlled environment.
He entered the proper security codes to get in, he put on the Hazmat suit, then went through the titanium-reinforced door to the temperature-regulated room that housed the T-virus, again entering the proper security code. The little-kid computer was none the wiser.
He walked over to the far wall, which included a PlastiGlas window, and a horizontal slot under it. Spence opened the slot by activating a control. It slid downward, allowing him to slide the case into the small chamber. Smoky condensation puffed out through the slot, as the temperature inside the chamber was quite low, and only the Hazmat suit kept him from feeling the overwhelming cold that issued forth. - Resident Evil: Genesis
"Ready for the meal of a lifetime?" Alice asked as Lisa stepped off the train along with a few other employees looking forward to a day breathing air that hadn't gone through the Hive's filtration system.
Although the Red Queen seems to have been 100% successful in killing the airborne virus in this way (hence why the team are able to enter the facility), the blood-borne infection remained within the hosts where she was unable to touch it.
Red Queen: The T-virus escaped into the air-conditioning system and an uncontrolled pattern of infection began. The virus is protean, changing from liquid to airborne to blood transmission, depending on its environment. It is almost impossible to kill. I couldn't allow it to escape from the Hive, so I took steps.
There's also a realistic possibility that the virus denatured on its own once released into the air (similar to the way that other infections such as influenza cease to be infectious after a brief period due to UV radiation and filtration) and that its airborne vector is quite limited, in which case it was simply time that allowed the virus to become ineffective.
Notably, Alice is also largely immune to the effects of the virus (a major point of the next few films) due to a natural immunity, although this subsequently turns out to be not entirely correct as we learn that exposure to the virus has enhanced her strength, intelligence and psychic abilities.
A more limited immunity is shown by several other characters in the franchise; Jill Valentine in the films and Rebecca Chambers in the video game
As the Red Queen states:
?: Why did you kill every body down here?
Red Queen: The T-virus escaped into the air conditioning system. And an uncontrolled pattern of infection began. The virus is protean, changing from liquid to airborne to blood transmission... depending on its environment. It's almost impossible to kill. I couldn't allow it to escape from the Hive. So, I took steps.
Red Queen: You must understand... those who become infected, I can't allow you to leave. ?: We're not infected.
Red Queen: Just one bite... one scratch from these creatures is sufficient... and then you become one of them.
?: Because she was saving [The Final Boss, The Licker]. For us. Isn't that right?
Red Queen: I didn't think any of you would make it this far. Not without infection.
Alice: Why didn't you tell us about the antivirus?
Red Queen: This long after infection, there's no guarantee it would work.
A minute later:
Red Queen: I can give you the code. But first, you must do something for me.
?: What do you want?
Red Queen: One of your group [Rain] is infected. I require her life for the code.
?: The antivius is right there on the platfom!
Red Queen: I'm sorry, but it's a risk I cannot take.
All of this shows that the t-Virus has mutated to the point that it is no longer airborne. All infections after the initial outbreak are physical, through a bite, scratch, blood splatter. Simply being there is no longer enough to get infected. Rain is bitten, Matt was licked by the licker, etc. As the Umbrella team showed up just hours after the event, this means only people in the Hive at the time would ever get infected via airborne vectors. The Nerve Gas that knocked out and gave Alice, Matt, and Spencer amnesia only worked for hours:
Umbrella Soldier: A nerve gas was released into the house. Primary effect of the gas: Complete unconsciousness lasting up to four hours.
The Red Queen didn't try to kill the virus with the fire suppression gas and sprinkler system. She tried to stop the virus outbreak by stopping it's infection vector, Infected Humans and Animals. She, being the main computer for the Hive, knew exactly how the t-Virus acts. Umbrella has been experimenting on it in the Hive for a long time. The reviving of the dead was already known. It's viable airborne infection time is well known. The t-Virus was being designed as a weapon and it being airborne for any large amount of time would make it incredibly unwieldy as a weapon. The primary weaponized vector was always the undead, not the initial airborne vector. This is why she decapitates the guy trying to escape in the elevator, drowns the ones locked up, and gasses the rest. She knew she couldn't kill the virus, she said that outright. She could only contain it, and the infected, at any cost. She intentionally gassed and killed all the humans, not a side effect.
James Shade (Umbrella Commando Leader): Five hours ago, Red Queen went homicidal. Sealed the Hive and killed everyone here.
TWELVE: Why kill everyone in the Hive?
RED QUEEN: Because there was a leak. T—3 escaped an unplanned pattern of infection began. Once the virus was loose, I couldn’t allow anyone to leave the Hive. So I took the appropriate action.
SPENCE: You butchered them.
RED QUEEN: If one infected human had escaped from the Hive...
A green holographic projection springs up in front of the Box. It’s a map of the USA. A tiny pin prick of red appears in the map.
RED QUEEN (CONT’D): ...the infection would have spread to cover the United States within 13 days.
Earlier in the script, showing it it was always to kill the infected. Airborne infection was never a concern:
The Medic uses a hand held device to sample the air.
MEDIC: Halon content in the air is high. That must be how she killed then.
ONE (James Shade): Do we need masks?
MEDIC: No, it’s breathable now.
Alice is only infected after being captured at the end, by Umbrella scientists as an experiment. The whole Raccoon City outbreak (Resident Evil: Apocalypse) was caused by these same scientists ordering the Hive to be reopened, releasing the zombies and lickers stuck inside.