That's how the world works, and that's how it has been for a long time. Crossing borders without permission is not allowed. So if you want to visit another country be sure to get permission, by going to an approved crossing point and showing your passport.
Entering a country some other way does not automatically make you a refugee.
Why not stay in your countries and work to improve them? The answer is that an immigrant from a dirt poor country can make a lot of money here ($20/hr here in CA for fast food worker) and send significant amounts back to their home country.
Perhaps under Trump, the USA can explore a similar program with South American countries, such as Venezuela?