Creatures of those types have disadvantage on attack rolls against the target.
43+ D&D 5E Protection From Evil And Good
Pics. Aberrations, celestials, elementals, fey, fiends, and undead. The target also can't be charmed, frightened, or possessed by them.
Godly Construct of the Astral Plains (5e Creature) - D&D Wiki from s-media-cache-ak0.pinimg.com
However, that view doesn't square very well with the formulaic nature of d&d spellcasting. The best option for any cleric domain, flight and strength bonuses. And it protects you from:
Protection from evil and good.
The rules in the stat block of the intellect devourer are more specific and allow the casting in a given circumstance even. Knight god who defends the weak, especially children. In the spell entry, it states that it offers protection from abberations, elementals very well put. The target also can't be charmed, frightened, or possessed by them.