There were rebels on the Scarif and Tarkin wanted to punish them for taking this step to stop Imperial from keeping the galaxy feared of the Death Star. For him, rebels weren't able to complete their mission, so finishing them has eliminated the risk of leaking plans of the Death Star. While talking about the remaining rebels in the space, he trusted Darth Vader to finish them.
From his perspective, firing on Scarif would erase all the traces of Death Star and other archives which were compromised apparently. He wouldn't care about the rest of the plans as he has now the ultimate power in the universe. And this was also a chance to demonstrate how powerful this weapon is.
Motti: This station is now the ultimate power in the universe!
And why would he kill all his soldiers and other staff? Well, according to him, they have failed at keeping the archive secured. He couldn't risk the safety of Death Star because of their failure. For him, they were just little expenses to keep Death Star safe.
From Filmcolossus article (emphasis mine),
Jyn, Cassian, and the Rebels have attacked the Imperial base at Scarif. Their goal is to steal the Death Star schematics and forward them on to the Rebellion so the Rebels can expose the Death Star’s fatal flaw and destroy an otherwise unassailable force. Understanding how important it is for the Rebels to fail, Grand Moff Tarkin fires the Death Star in order to destroy Scarif. All the soldiers, the entire base—it’s all a justifiable expense in the case of protecting the Death Star.