They give you resources and score.
Each crystal will give you 0.25 metal and oil per tick (this stacks with everyone else in your alliance, so if your alliance has 400 crystals in total, you will get 100 metal/oil extra per tick).
The most obvious purpose for crystals is score though. Owning crystals grants you 20 score. Owning many crystals will increase your score a lot, however it will also increase the threat of someone wanting to attack you to take those crystals