The Fez the traditional hat originated in Fez Morocco in the early 19th century it was commonly worn in the Middle East and in Africa so Shriners adopted The Fez as a ceremonial headdress to add an air of Mystique now this was after an actor Billy Florence was tasked with
Creating the backdrop for the Shriners leading up to the creation of the fraternity in the 1870s so the more you know about The Fez
source