The purpose of separating families is pure political maneuvering to get democrats on board with funding his wall.
Plus, "proving" he is keeping his campaign promises keeps his base solidly behind him. Trump does not care to be a president for all citizens - only his slavering, gibbering base is what he cares about. And they want immigrants punished as severely as possible.
Regarding his promises, why doesn't he keep the second part of that promise to build a wall, which was, that Mexico would pay for it! Seems that has been forgotten.