They are not really villains. The trio at the centre of Birth by Sleep are Terra, Ventus and Aqua, whose names carry meanings of earth, wind and water.
Set that against Sora (sky), Riku (land) and Kairi (sea) and the pattern is obvious: the names are a matched set, which suggests the three are predecessors and counterparts rather than antagonists. The game itself makes their roles considerably more complicated than good versus evil.