WASHINGTON—Bitter fights over trade within the Trump administration again broke into the open, driving wild swings in the stock market as the White House’s top trade adviser clashed with the Treasury secretary over restrictions on foreign investment.

For weeks, the administration has been planning a two-pronged effort to block Chinese companies from obtaining advanced U.S. technology. The U.S. would block Chinese companies from investing in U.S. technology companies, while restricting U.S. technology exports to China. Beijing...