The problem is the DUP. May requires their support in Parliament, and I'm not entirely sure what the DUP wants is what's best to avoid reigniting the Troubles. I know my friends in both Ireland and Northern Ireland (Protestant and Catholic) were very much of the opinion that May was making a deal with the devil, and that it wasn't going to be good for the Good Friday Agreement.
Ireland and Northern Ireland desperately want to prevent a hard border in order to maintain the hard-won peace and prevent the return of the bloodshed that drenched the island (and the rest of the UK). Ireland being in the EU, the EU has put its weight behind Ireland. That's how amplification of international clout/power through shared institution works.
In fact, the UK government also claims to want to prevent a hard border, yet has provided no way of actually doing so except "magically it won't be there", and the only practical solution (discounting magic) is for NI to remain in the CU and SM. That has been clear from the start.