I once calculated that all the convicts in California prisons could be housed in a single facility built one cell wide by 140 miles long, which is, coincidentally, the exact same length as California's border with Mexico!
With this system, the only way for an illegal to get past that barrier and into the U.S., is to first break into prison and then break out again! This concept can be scaled up to cover the entire border from California through Texas. No longer will you have a need for a fence nor need for a military to keep the illegals out.
Paying for this is the simple part. Much of the land where prisons are currently located is on valuable land. Sell the land, buildings and facilities and buy up the much cheaper land along the border. You want cheap jail cells? Look into tilt-up concrete prefabs.
--Boot Hill
Workable?