The primary reason for the wall is to ensure the safety of the people of the US.
It is necessary for 3 reasons.
1. Reduce the possibility of Terrorists easily crossing the border to get into the US and setup shop here.
2. Reduce the billions of dollars of illegal drugs coming into the country by the Mexican Drug Cartel. The Cartel also engages in human trafficking and contraband like guns and weapons. These drugs are consumed by people in the US. Their use of drugs can then be the source of more crimes, drug dependency, drug deaths, including suicides, driving under the influence of these drugs, and a burden on the US healthcare. They can also be responsible for crimes in connection with being able to get funds to purchase these drugs. There are also gang crimes involved the distribution of these drugs, as well as in the protection of their drug territory. These gangs also have a large presence in our jails and prisons, and they even continue to do business while incarcerated. It is a huge burden on law enforcement and the judicial system. With these direct and indirect costs the wall could have been built numerous times. And how do you put a dollar value on loss of life or disability caused by these illegal drugs.
3. There are millions of legal immigrants that not only can do the jobs that we attribute to needing illegal immigrants to do, but they are already doing these jobs. These illegals don't pay their fair share of taxes, one only has to go the post office on Mondays, and see all of them sending their money earned here back to Mexico. They also consume a fair percentage of our school seats, and welfare for themselves and their children. Many of them commit crimes here in the US and many get away with it. They also burden our emergency rooms at our hospitals and they don't have to pay. Some one has to pay, and it is the Americans and legal immigrants. Especially thru the mandated health insurance under Obamacare. These illegals also proudly burn the American Flag while flying the Mexican Flag in the streets of Los Angeles while Protesting their demands from the US.
At the same time these illegals are getting defact American Citizenship rights, they are discriminating against those immigrants that want to come into the US legally. Millions of them are rejected because of country quotas, while the illegals don't have any quotas, and even when found after illegally entering the country they are permitted to stay.