Look at the populations in those areas of Africa. In Eastern Africa, the nations there were and are dominated by Arabs, who were merchants and businessmen, mostly. So Europeans traded with them and also colonized some of those regions for the wealth there.
In Western Africa, the European powers, rather than colonize, instead stole millions of Africans as slaves to take to the New World and their colonies there. Over 3 million were stolen by Portugal alone and taken to present day Brazil. So they viewed Western Africa as a source of labor and profit, and Eastern Africa as a place to colonize and do business in.