It's not a defense issue, it's a law enforcement issue. Which is why law enforcement agencies (ICE, CBP) are the ones enforcing laws against illegal entry. The military is generally only mobilized at the border when large groups are poised to cross the border in numbers large enough that ICE and CBP don't have the manpower to stop it.