If Democrats were sincere when they say that walls don't work, their logical course of action would be to let President Trump have his wall. Then, when the wall failed, "Trump's Folly" would be a great political issue for the Democrats.
But the Democrats aren't being sincere. They're terrified that the wall will work, thus giving President Trump an even better political issue.
That's the real reason for Democratic opposition to the wall.