There are 3 main traditions of scripts. Each has a halachic basis.
Bais Yosef: This is the script (for Torahs, tefillin, mezuzahs and megillahs, used by those of Ashkenazi decent, who are not Chassidic. The Bais Yosef, authored by Rabbi Yosef Caro, (1488-1575) is the famous commentary to the Tur, (1200’s) one of the earliest halachic codifications. He is also the author of the famed Shulchan Aruch, the most authoritative halachic codification. This particular script has the earliest and most solid halachic foundation however, the style has changed (not always within the confines of [preferred] halachah) and has developed throughout the generations. The Bais Yosef style of today has developed into a more literal interpretation of the halachah and is universally accepted as a mehudar form of the Bais Yosef script.
Arizal: The Arizal style script is the same as Bais Yosef other than some minor changes in 6-7 letters. This style is named after Rabbi Yitzchak Luria Ashkenazi (1534-1572). He was a famed and great kabbalist, scholar and pious one. The changes to the Bais Yosef script that he instituted are based on kabbalah. It is the custom of most who are of Chassidic descent to use this script style
Vellish: This is the script style of Sephardic Jews. Interestingly, the Sephardic Jews, who carefully follow the halachic decisions of Rabbi Yosef Caro, himself a Sephardic Jew and bases most of his decisions on the great scholars of Sephardic Jewry, mainly Maimonidies (1135-1204) and the Rashba, (1235-1310) have a different tradition of script altogether.