Sorry, I was thinking that the communists used the "logic" of keeping out capitalist pigs, but a little digging showed me I was wrong. It was built to stem the tide of refugees fleeing East Germany. Originally, it was a barbed wire fence with sentries, guard towers and mine fields. I don't remember much about because because, at the time, I'd just turned 4 and was still thrilled about my new AMF red and white Tricycle. None of the history classes I took in school ever got far enough in the book to mention WWII, much less the cold war. FML. But then, the cold war was under Current Events as I was growing up.
I don't think the wall is the right answer, though. Eventually, pressure from the citizenry will cause the marijuana laws to be changed so that the cartels won't need their tunnels to smuggle drugs in, so they'll use those tunnels to smuggle refugees in for a price. It could turn out more lucrative than drug smuggling.