Why is it that we Anglicize some foreign proper nouns, but not others?
There is a general tradition in North America of not translating Spanish or Native American place names. We say Los Angeles, not City of the Angels, and Connecticut, not Long Tidal River. (We do tend to anglicize the pronunciations.) In a place like California, Spanish had been well established for a long period before English-speakers arrived in significant numbers, and we still have a sizable Spanish-speaking population. The Spanish place names became well entrenched and continued to be used by Spanish speakers. Since we don't translate our own local place names such as Costa Mesa, it seems pretty logical to me that we don't translate foreign ones like Costa Rica.
Côte d’Ivoire is actually now supposed to be referred to as Côte d’Ivoire, not as Ivory Coast, so that doesn't seem like a good example.
Whether or not to Anglicize a name is a controversial and dynamic question. with a changing answer. It usually boils down to a (changing) consensus and common usage.
Ben Crowell is right about the habit of keeping Spanish language names in North America, with Puerto Rico, San Juan and San Francisco being excellent examples.