Your question assumes that everything has a purpose in itself. What's the purpose of the mathematical organization of large flocks of starlings? Organization is just something that happens, given the right circumstances.
It's like asking, what's the purpose in these patterns: Link
God created a universe within which organization and increasing complexity is natural.