She doesn't murder Wesker, at least initially, the door only closes on his leg breaking it in two. Wesker and Isaacs are, however, planning to destroy the world to remake it as they see fit. The better solution to save humanity is to save as many people as possible in the Red Queen's eyes, the reasoning for her betrayal is essentially the same as the reasoning I give here. The Red Queen decided on her own way to save humanity and it differed to Isaacs' way so she had to stop Isaacs and Wesker as their views were in direct conflict with her own.
Dr Isaacs: We're here today, not just to talk about the future of this company. We're here to talk about its destiny. We're here to talk about the end of the world. We stand on the brink of Armageddon. Diseases for which we have no cure. Fundamentalist states who call for our destruction. Nuclear powers over which we have no control. And even if we navigate these dangerous waters, we face harder, even more inevitable threats. Global warming will melt the polar ice caps within 80 years, flooding 90% of all habitable areas on Earth. Unchecked population growth will overtake food production in less than 50 years leading to famine. And war. This is not conjecture. This is a fact. One way or another, our world is coming to an end. The question is, will we end with it?
Alicia: What do you propose?
Dr Isaacs: I propose that we end the world... But on our terms. An orchestrated apocalypse. One that would cleanse the world of its' population but leave its infrastracture and resources intact. It's been done once before. With great success. The chosen few will ride out the storm, not in an ark as in the book of Genesis, but in safety. Underground. And when it's over, We will emerge onto a cleansed Earth. One we can then reboot. In our image.
Male board member: And just how do you intend to achieve this?
Dr Isaacs: The means of our salvation are already at hand. I give to you, the T-virus.
Resident Evil: The Final Chapter
The Red Queen also goes into more information earlier on as to why she decided to turn against the Umbrella Corporation after showing Alice the recording where Isaacs tells the board of his plans as outlined above.
“When this recording was uploaded to my data stream, it created a conflict in my programming. I was created to serve the Umbrella Corporation, but I was also programmed to value human life. When we first met in the Hive, you referred to me as a ‘Homicidal Bitch.’ Quite unfair. And inaccurate. I was seeking only to stop the escape of the T-virus to prevent an even greater disaster. But despite my efforts, Doctor Isaacs ordered the Hive reopened. He deliberately allowed the virus to escape. He murdered over seven billion people.”
The Red Queen disappeared again, replaced by a barrage of images recorded from various surveillance cameras showing Undead and monstrous mutations slaughtering humans by the hundreds. The Red Queen then returned to the screen.
“So, you can see my predicament. The people I was created to serve have caused the loss of countless innocent lives. But my programming will not allow me to harm, or through inaction allow to be harmed, an employee of the Umbrella Corporation. I am powerless to stop them. But you are not.”
“In thirty-seven minutes, Umbrella operatives in Kyoto, Paris, New York, and Berlin will act. The time is prearranged to ensure that they strike at the same moment. This will prevent one settlement from warning another of the existence of a traitor. The last of the besieged settlements will fall. There will be no survivors. It is imperative you release the antivirus before this occurs. Or Umbrella will have won.”
Resident Evil: The Final Chapter - Novelisation