WASHINGTON—Acting Navy Secretary Thomas Modly resigned Tuesday after an uproar over his verbal attack on the former captain of the virus-stricken aircraft carrier Theodore Roosevelt, in a saga that has dealt a new blow to a U.S. Navy beset by missteps and clashes with the White House in recent years.

Mr. Modly was under pressure to resign after an extraordinary chain of events over the past two weeks as the Navy and the U.S. military scramble to respond to the Covid-19 crisis, with more than 230 cases on the aircraft carrier...