The federal government is the one wild card on Wall Street that is wreaking havoc on stocks, CNBC's Jim Cramer said Wednesday.

President Donald Trump campaigned on business-friendly promises to cut red tape, but federal agencies led by his appointees have "declared war" on big tech and it's a "rude awakening," the "Mad Money" host said.

"After today, this White House is clearly not as friendly to big business as I know I thought. The days of corporations getting a free pass is over, unless they happen to be in Republican-friendly industries like coal and oil," he said. "That is a major shift, it's not getting enough attention."

The Justice Department on Tuesday initiated an antitrust review of Facebook, Amazon, Apple and Google-parent Alphabet on suspicion that their business practices limit competition. Their shares fell in after-hour trading following the announcement, while the stocks of Apple and Alphabet traded in the red on Wednesday.

Whatever comes of these investigations could lead to rules, such as those placed on Facebook, that stifle their innovation, Cramer said. While he sees the issue on both sides of the coin — anti-competitive behavior is anti-competitive, even if consumers benefit from lower prices — Cramer thinks it's an abrupt about face.

"It was shocking because the regulators have been laser-focused on consumer prices as the key antitrust barometer for ages," he said. "But it's been unenforced for so long that I'm indignant on Apple's behalf. While we need antitrust law, [it's] a little jarring when the whole regulatory regime changes over night from a Republican president who is anti-regulation."

Facebook, which has been embroiled in years of data privacy issues, felt the wrath of the Federal Trade Commission in a settlement that was announced Wednesday. The $584 billion social media giant was slapped with a $5 billion fine, but the most critical part was the agency's orders that the company place independent directors on its board to monitor CEO Mark Zuckerberg and that privacy decisions be handled by an independent privacy commission, Cramer said.

"This was a brutal decision. In a way, Facebook had it coming, but [FTC Chairman Joseph] Simons nailed them harder I think than if he had taken them to court," he said. "These are real restraints to the point where I think [it] will actually hurt their ability to make money, hurt their ability to be creative."

Two FTC members, however, felt the $5 billion fine was not enough, with one going as far to say that the settlement "gives Facebook a lot to celebrate."

Shares of Facebook initially fell after the announcement, but managed to climb more than $2 during the session before posting second quarter earnings and revenue numbers that topped estimates. The Dow Jones Industrial Average fell nearly 80 points on the day. The S&P 500 rose 0.47% and the tech-heavy Nasdaq Composite lifted 0.85%.

From here on out, investors must consider how much government interference companies could face from the Trump administration, Cramer said. Many people have been concerned about what a potential President Elizabeth Warren or President Bernie Sanders would mean for stocks, but the issue exists here and now, he added.

It all began with Federal Reserve Chair Jerome Powell's "rookie mistake" last fall in proposing multiple interest rate hikes along with Trump's directionless trade fight with China that has been a drag on the market, he said.

"The tariffs and Jay Powell's missteps have created quite a thicket for corporate America. I think the stock market would be substantially higher without these two albatrosses around our necks."