The idea is that Solomon practiced what was Biblically defined as the occult, so in theory, things like Osiris worship.
When the Templar excavated his temple, that is when they allegedly discovered these things, which they allegedly came to practice themselves.
A connection to Freemasonry is if Freemasons adopted these same things from the Templar, which I believe that they clearly have, one way or another.
One theory is that it all came together in Scotland, where some of the Templar fled, and eventually mixed in with Scottish Rite Freemasonry.