Does everyone prosper through development projects?
A lot of this comes down to risk. A developing country usually don't have very strong "institution" and are much more prone to various kinds of crisis (think military coup, hyperinflation, terrorist attack, nationalization*). An investor might also not be as familiar with the developing country in question* (and hence the risk).

As a result, investors require higher return (the "premium") to invest in these countries. You can see the risk premium by country here.

This is why developing credibility could be very helpful in terms of drawing foreign investment into a country.

* Added from comments below.