From what I understand, neither of the agreements were particularly centered towards increasing free trade; most of the countries involved already had free trade agreements already in place. The treaties were labeled as “free trade” agreements, but were really aimed towards reducing consumer protections and the ability of governments to regulate multinational companies, in order to boost corporate profits further. So “changing their mind on the subject of free trade” might be a bit inaccurate.
As to why the administration is willing to appear anti-free-trade by cancelling these agreements: Trump’s line on the campaign was that America wasn’t benefiting enough from TPP specifically, and free trade agreements in general, and that they need to be renegotiated so that America benefited more (he seems to be tied to “zero-sum” thinking, so if someone else is benefiting from the deal, the US must be losing out).