Acting Navy Secretary Thomas Modly resigned Tuesday, according to two officials, just hours after he had publicly apologized for a profanity-laced upbraiding of the officer he fired as captain of the coronavirus-stricken USS Theodore Roosevelt.