Naming the first secret society that's similar to those in the current era is a difficult task. The Egyptians had innumerable secret fraternities - most having to do with their complex and ritual-drenched religion. But one secret society wasn't quite as much a priesthood as the others. The society grew up out of one of the first figures in history who wasn't a pharaoh or a king. His name was Imhotep, and he was the chancellor, or grand vizier, for the pharaoh Zoser (also spelled "Djoser") in the Third Dynasty of the Old Kingdom.
Apart from being a master builder of the first recognizable Egyptian pyramid, Imhotep was also a physician, the father of Egyptian medicine. And as if these laurels weren't enough, he was an astronomer, a sculptor, a poet, and a philosopher whose sayings were cherished 20 centuries after his death. Later, Imhotep was made a god, with a highly imaginative lineage from a mating between a mortal woman and the god Ptah. But for the men of the cult of Imhotep that developed in the city of Memphis, he wasn't a god but a man, and was revered as such.
This cult had an inner secret society, a Brotherhood of Imhotep, that worshipped his ability as a builder and that created a metaphor for god as an architect, making for a striking similarity with the Freemasons who don't come along for at least another 4,000 years.