Because becoming a legal immigrant is hard for them. Entering illegally in the first place disqualifies them from getting a green card. If they leave, then return in the future if necessary, or when the situation is better financially for them, they will face 3-10 year bans. It's also expensive for the people entering especially if they have low savings, since becoming a citizen is a lengthy process for them. The undocumented in our country didn't find themselves with many choices, so that's why they just chose to enter illegally.