As to the claim that a border wall is not a “military expenditure” because DHS and not DOD would manage it, there too we’re to some extent in a boat without a legal paddle. My own view is that the defense of our borders is a core military concern that legitimately concerns the president’s duty to protect the nation from invasion. I think that it should not particularly matter which government department manages that concern. However, the president’s ability to divert funds might quite plausibly be legislatively confined to intra-department funding. I assume therefore that the President will order the military to have the wall built. The interstate highway system was authorized as a requirement of national defense, after all….
A third issue is whether the declaration of an emergency can authorize a long-term institutional change (as opposed to a short term fix). For example, I don’t think a president could invoke a national emergency to establish a “Space Force” as a fifth branch of the military — that’s a permanent policy change that properly belongs to the Congress. A permanent barrier is more of a technological solution to a security problem than the establishment of a new military branch, though. Again, were I a judge, judicial restraint would compel me to accept both the president’s proposed emergency and the solution he favors, subject of course to the Congressional check I discuss immediately below.