Same way we pay for the wall. It's just that school lunches have a tangible benefit.
Security isn't a benefit?
A hardcore Libertarian would likely tell you that neither border security nor school lunches are a benefit.
You are confusing two issues here:
Issue #1, Border Security:
As I've said repeatedly, we should secure the border even if we are going to allow more-or-less unlimited immigration. There is still a need to know who is entering the country and how many.
Issue #2, immigration policy:
In my opinion our national policy should be to benefit our nation. Thus we should not allow anyone who will be an economic detriment. Welfare recipients, unskilled laborers, anyone too old to likely pay enough in taxes to cover their old-age costs that our government will absorb, etc.
Since you have criticized not just the wall but all Border Patrol expenditures generally, I have to ask: Is it your opinion that we should eliminate all border security expenditures?
Similarly, since you have opposed prohibiting immigration by obvious financial liabilities, is it your position that we should have no limits on immigration?