I think this is a tactical error on Trump's part, but he seems to have the ability to dive in a pile of do-do and come out smelling like roses and cinnabuns.
That said, Mexico paid for it's wall on the southern border, so there is a precedent.
Big picture, Mexico is like that spoiled teenage punk little brother that needs his a** beat. It's time for them to grow up and stop being the dysfunctional little narco state.