This interview would indicate that he understands that, and wants to restrict immigration for that very reason: https://www.youtube.com/watch?v=vf-k6qOfXz0
Edit: The interview is from 2015, so it may be that his understanding has 'evolved' since.
Most border crossings aren't even prosecuted.
Increasing the number of them being prosecuted places a massive burden on the court system and results in the various unjust scenarios we have today. https://www.nytimes.com/2018/06/19/us/border-immigration-cou...
There isn't any evidence that criminalization decreases the number of border crossings either.
Indeed, immigration levels haven't decreased under trump despite the massive increase in prosecutions.
Given this, it isn't absurd to think that other approaches would be at least as effective at controlling immigration in practice.