Why would any branch of any military actually need a VR simulation of any period in history?
Combat flexibility perhaps. Or they could be training or measuring soldiers putting them in all sorts of situations to see how they would react or fight in those periods.
If it's supposed to be a simulation of an actual period in history, what the hell are Magic Missile pickups and a wizard and that flying demon-gargoyle thing doing in the medieval level?
The simulations are never outright stated they're meant to be 100% faithful to the real life periods. That aside, it could also be for the same reason as above: Combat flexibility. To see how one would deal with fantastical enemies using even ununsual weapons.
Why did a company employee sabotage the project he was working on?
The opening cinematic explicitly says he's a mole from a rival corporation. The narration is absent in European versions of the game, so it's easy to make this misassumption.
Why didn't the test server have anti-virus software installed?
It probably had but the virus could be something new that easily bypassed it, especially since the rival company had a spy who could've gathered enough data to create a virus that could ignore any security measure, or have clearance to inject it ignoring said security protocols. Alternatively people like Stanley Opar, the main character, are the anti-virus at worst case scenario (the game itself).