In making a judgement about building a wall, the politicians must weigh various risks - including terrorism, illegal immigration, drug trafficking, engineering costs etc. - as well as the likely effects of a wall on the risks, the environment, the economy etc.
Practicality is also an issue, although my feeling is that the will to do so is more relevant than the creativity of engineers.
Of course, a "wall" is not necessarily something made of bricks and mortar along the length of the border. It can be geographical features (true also of China's wall) and it can be virtual in parts.
A wall is not the only sort of immigration control. The burden on embassies, ports and airports remains.
In Europe, free (borderless) movement according to the Schengen agreement has mostly been abandoned. This results from the massive wave of (mostly) Moslems entering Europe through its outer borders and Moslem terrorists setting up cross-border activities within Europe.
Frontiers are especially useful when the threat level is high. Not sure if the Mexican "threat" quite matches the threats Europe faces.