He said he hopes the treasury's actions will deter the deals, but noted his administration cannot eliminate the loophole on its own. He called on lawmakers to eliminate "wasteful" loopholes that he said favor wealthier Americans and powerful corporations.
"Only Congress can close it for good. And only Congress can make sure that all the other loopholes that are being taken advantage of are closed," Obama said.
He contended cutting loopholes and boosting tax revenue would create more revenue to fund infrastructure and education.
The Treasury Department's announcement Monday hit shares of Dublin-based Allergan, which has agreed to be bought by Pfizer in the largest inversion deal ever. The pharmaceutical company's stock plunged more than 15 percent on Tuesday.
In a joint statement Monday, Pfizer and Allergan said they would review the Treasury Department policy but would not speculate on its possible effects.
— Reuters and AP contributed to this report.