Basically, they spoke about what they believed as truths in allegories without breaking character when it came to dealing with those they considered profane. They share them as if they believe them because they do believe what they represented and therefore it was not a lie to speak of them as real since what they represented was real and true to them.
They never spoke openly to the profane/ignorant masses because they always considered it unwise to do so. There stance was only those who had proven their worth were permitted to know the mysteries of the universe. Pythagoras reportedly even made his students remain silent for 5 years before revealing the inner mysteries of his school. The thing you must keep in mind is most all these famous ancient philosophers had their own schools whose teachings were never made public and for anyone to achieve success in them they had to undergo very rigorous training and discipline before the mysteries were shared. There is even an ancient letter written by Alexander The Great to Aristotle where Alexander rebukes him for revealing too much in his public teachings and how he needed to stop because his power depended on this knowledge.
So, it is important to distinguish between those who were initiated into the mystery schools and those who weren't. The way Greek, Roman, Babylonian, and Egyptian mythology is taught today is how it was taught to the masses back then. But everything I have said is well documented and many a source verifies it. And I don't mean modern sources but if you truly go back and start digging through their writings this theme comes up over and over again. And this wasn't just unique to the pagan schools but also exists within Christianity as there is a time in the Gospels when Christ was asked why he never spoke plainly to the people but always taught them through parables and allegories. Christ responded to his disciples saying "because it was not given to them to know the mysteries of God's kingdom because having eyes they see not, and ears they hear not, neither do they understand. Therefore I speak to them in parables".
Also, the mystery schools are very much alive and well today.
So, it's important to distinguish between the exoteric and the esoteric.