In Ancient Greece, there were many different phenomena in the world that were explained by stories or myths, usually involving gods, such as the changing of the seasons or the obtainment of fire. Other times, myths served as intriguing plays meant to be dramatized on stage. Did the myth of Oedipus serve a similar purpose?
[Caveat: personal interpretation]
The lesson is that Fate reigns supreme over mortals and that you can't escape it. It also acts as a meta-rule for other myths. Since prophecies are bestowed by the gods, it's about remembering one's place in the universe and not questioning it.
It's a recurring theme in myths involving prophecies across western cultures, as well as in stories that involve characters breaking customs or not respecting rituals. If you agree that one of the purposes of myths is to reinforce norms, this kind of story is about the power of the myths themselves, how they shouldn't be dismissed. I can't think of a single instance of a classical protagonist who defied Fate and profited from it.
Well, we learn from this myth that destiny cannot be avoided. Therefore, although the king knew his future he was unable to change it, and this myth emphasis that no one can change fate even gods in Greek during that period of time.