The budding cannabis industry cooled off in July after a couple of businesses came under fire in recent weeks, CNBC's Jim Cramer said Wednesday.

The scandals have caused stocks in the marijuana sector to simmer with a number of equities falling as much as 20% this month, he said. U.S. and Canadian officials have targeted both CannTrust and Curaleaf for improper businesses practices.

"I think you need to be incredibly selective here. I still like Canopy Growth and Cronos, the two best-funded Canadian cannabis plays," the "Mad Money" host said. Their stocks are down about 20% and 15%, respectively, "but these are long-term stories. You need to be prepared to buy them gradually on the way down."

Earlier this month, CannTrust halted sales of its cannabis products after Health Canada, the country's national public health arm, declared the company non-compliant for growing marijuana in unauthorized rooms in its facility. Officials are investigating if the products are safe for consumption, Reuters reported.

Shares of CannTrust, which first received its medical marijuana license year prior to cannabis legalization in Canada, peaked at $10.17 in March and has lost more than 75% of its value. Investors were buying into the company's potential to produce as much as 300,000 kilos of weed by the end of 2020, Cramer said. After missing Wall Street revenue and profit expectations in 2018, Canntrust turned a profit and beat estimates in its first-quarter report of 2019, according to Factset.

But the board fired CEO Peter Aceto last Friday as a result of the scandal. Furthermore, management tamped down its 2019 forecast. The stock did manage to bounce from a $1.87 low last Thursday and climbed nearly 10% to close at $2.45 in Wednesday's session.

"As the scandal keeps blowing up, the pin action has been horrendous for the rest of the group. Some analysts are talking about a CannTrust contagion," Cramer said.

Elsewhere, shares of Curaleaf are trading more than 30% under its $11.73 high in May. The U.S.-based medical cannabis company landed a partnership with CVS to sell cannabidiol (CBD) products, but the country's Food and Drug Administration last week warned it was selling the products illegally with unsubstantiated treatment claims, CNBC reported.

In a press release, Curaleaf said it had removed any references to non-compliant products from its online platforms. CEO Joseph Lusardi said in a statement that the company "appreciates the work the FDA is doing to ensure there is regulation and compliance in the CBD marketplace."

"After initially getting slammed, the stock managed to bounce back. They may just need to change how they label this stuff. Still, it's clear the FDA is starting to flex its muscles against cannabis," Cramer said.

MJ, the ETFMG Alternative Harvest ETF monitoring legal cannabis businesses, itself fell more than 12% in July. Cramer previously said the declines are a sign that there is a paradigm shift in the industry as marijuana investors "are starting to care about the actual results, for once."

"When it comes to the marijuana space, the new paradigm it means you need to stay away from companies that only have vague plans pending regulatory approval that are losing a lot of money," he reiterated Wednesday.