It isn't as "simple" as you think. These people decide to risk everything and come to a foreign land where they don't even understand the language or have legal status. What would cause someone to decide that? It's anything, but simple. If it were simple illegal immigration wouldn't be a controversial topic.If you illegally cross into a country, it makes sense that your children are taken from you. These are people who are dodging the legitimate ports of entry and caught. The children are treated well.
If you want to keep your children, stay where you are and raise them. It's simple.
Laws should be enforced, otherwise there would be chaos, but we should remember that laws are made by people and people make loads of mistakes.