We do this in limited areas already -- there's razor wire and other "obviously dangerous" stuff protecting power substations, subways, power plants, etc. DoE-mandated security contractors will use lethal force at nuclear sites, probably with limited target identification.
I agree doing this over a 2000 mile border is a bad idea. For that, we should try to develop 0-50mi deep monitoring zone (depending on the area), with seismic sensors, UAV overflights, etc., and then whenever anyone is detected, send CBP/ICE agents to intercept. If they're innocent hikers, no harm done; if they're drug/people/etc. smugglers, detain and process them.
That's largely what we do now. The main issue is insufficient CBP agents, and no real consequences for illegally crossing the border ("catch and release"). I think punishment should be much harsher for anyone involved commercially in running the border, and somewhat harsher for people who do it repeatedly.
Ultimately the best solution is to make Mexico a less shitty place to be.
Well, that's all pretty reasonable, including the harsher penalties for people who run the border for a business, but still, seismic sensors and UAV overflights? That's just too close to home for me, I don't want a militarized border if it can at all be avoided. Aside from the monetary cost, I think it's detrimental to society -- is immigration such a bad problem that it requires that drastic a step?