Answer
When the Roman Empire ruled northern Africa, they referred to the native people in the same way as the ancient Greeks had: as “Barbarians.” This word eventually evolved into the term Berbers, used mostly for the African people living near the Mediterranean Sea. But another Latin (Roman) term for these people was Mauri. During the centuries leading up to the first Crusade, these Islamic people conquered what are now Spain and Portugal. The Europeans referred to the Muslim invaders using derivatives of their Latin name, which in English worked out to the term Moors.
Even early on, the term Moors carried an imprecise meaning. It was mostly applied to the Muslim conquerors of southwestern Europe. However, none of the Greek, Roman, or European titles for this people group were very specific. The term Moors was not, and is not, used by any particular group in reference to itself. The two distinguishing characteristics of the Moors, from a Medieval European perspective, were Islamic religion and African ethnicity. As a result, the term Moors quickly became a European catch-all for both Muslims and Africans. The era of the Crusades, in particular, gave the term Moors a negative connotation.
This puts the term Moors in a category with other generic ethnic and racial terms. As history shows, most such terms are gradually abandoned in polite conversation and are eventually considered offensive. Even terms that carry no particular malice can, over time, be set aside for the same reason. A relevant example of this is the term Negro, which was used by U.S. civil rights leaders of the 1960s but is no longer considered an appropriate label. A more current example is the term Oriental, which is experiencing a similar decline in acceptance.
Historically, the Moors were a group of Muslims from northern Africa who invaded Europe. Even at the time of the Crusades, the term Moors was generic and not used by the Africans themselves. In modern European use, the term Moor or Moorish is almost always used as slang, an insult, or in reference to something other than a people group. In ancient contexts, a Moor was a Muslim of African descent.