Assuming that nothing else prevents the cleric from turning a given swarm -for example, not having enough dice- the fact that it's a swarm won't prevent the cleric from turning it either.
A swarm is a single creature in D&D. The collective essentially takes on its own quasi-existence, independent of but coterminous with the creatures that comprise it: a hive-mind, collective unconscious, or whatever you want to call it. This single creature is what the cleric turns. The creatures that comprise the swarm (scarabs, in this case) merely follow the swarm, because that's what swarming creatures do: technically you haven't turned any one scarab, but because you turned the swarm, the scarabs act as if turned.
In theory you could use the mob rules to turn large groups of bigger creatures -say, an entire zombie horde- as a single creature, but the CR for something like that should probably be really, really high: best left to epic levels.