President Trump replaced the Pentagon’s acting inspector general, who had been charged with monitoring the roughly $2 trillion pandemic stimulus law, administration officials said, the latest shake-up in a bid by Mr. Trump to exert increased control over personnel across the government.

Mr. Trump’s removal of Glenn Fine, a longtime federal watchdog who has been at the Pentagon since 2015, is the second high-profile ousting of an inspector general in recent days. Last week, the president fired the intelligence community inspector...