Why didn't the Persians take advantage of the Peloponnesian war in order to invade Greece?
I know that they financially supported Sparta. They favored the land-oriented Sparta, instead of a navy power like Athens, which could be a constant threat for Asia Minor.
But why didn't they invade directly Greece , AFTER the Peloponnesian war had ended where the Greek States were in a weak state?
Well, they did sort of. The Spartan deal with the Persians greatly favored the Persians. While the Spartans got money for a fleet (and not much else--the Persians didn't even tell the Spartans what they were supposed to do with their ships, even though the leading Spartan generals had no idea what they were doing) the Persians were granted control of all the cities of Asia Minor, from which they had been pushed at the end of the Persian Wars. The Greeks fully expected the Persians to try a third time, at the very least to secure Ionia and the other Greek cities of Asia Minor. It is extremely fortunate for the Greeks that Xerxes' death began a period of extreme upheaval in Persia, with multiple satrapies in revolt and lots of disputes over the throne. Xerxes' successor, Artaxerxes, attempted a series of massive ritual and administrative reforms, while also trying to squash insurrections like the one in Egypt, which was Athenian-led and caused a major problem. During much of the Peloponnesian War the Persians were busy with their own civil squabbles, as Darius II marched on the throne after his brother was assassinated and trying to keep the eastern satrapies in the fold. Most Persian actions were carried out by the satrap Tissaphernes more or less independently. Across the reigns of several Great Kings, Tissaphernes proved to be a master of diplomatic action, playing the Greeks off against each other and giving each side support in turn, but only enough to ensure that the struggle be prolonged, not that anyone would actually win.
But why didn't the Persians invade at the end of the war? First, Greece wasn't quite so weak as it may seem. Although order had been thoroughly disrupted and Greece was in shambles (the Peloponnese in particular was devastated, a result of ruthless Athenian raids on coastal towns and farmland), the Lacedaemonians were the sole hegemon in the Peloponnese and had tied their allies to the north, namely the Boeotians, to them with ever-increasing bonds of military assistance and tribute. For about a decade the Lacedaemonians were incredibly powerful, although after the Corinthian War, when pretty much everyone in Greece banded together to overthrow the Spartans (who had not only lied about their promises of liberation--see what they did to the Ionians--but were exacting tribute several times higher than what had been paid to the Athenians--on their own allies, not just their subjects--and also dared to install garrisons in many allied cities) Greece devolved into a state of near-anarchy. Persia was having its own trouble. The insurrection of Cyrus the Younger coincided exactly with the end of the Peloponnesian War, obviously preventing the Great King from doing anything in Europe. And the Ten Thousand, while not immediately damaging, were still extremely jarring, since they were able to march around pretty much at will. The Persians were also subject themselves to invasion from the Greeks, not vice versa, when Agesilaus landed in Asia Minor to liberate the Ionian cities (which, yes, they had handed over to the Persians--the Spartans weren't the best at keeping friends, especially after their victory over the Athenians). This invasion, while of doubtful success, was enough to really ruffle Persian feathers, and even resulted in the death of Tissaphernes, who, despite his invaluable assistance previously, paid for his failures during this campaign and his failure to annihilate the Ten Thousand with his head.
So Persia was really not in a position to mount a large land invasion of the Greek mainland, especially considering how immensely costly it would be. And things in Persia weren't much more organized than in Greece in the 4th Century. Artaxerxes III defeated his rivals in a bloodbath of assassination and civil war, and although he did manage to finally squash most of the rebellions (including the one in Egypt), by his death in 338 things weren't particularly stable. His minister Bagoas (who probably murdered him and murdered all his children and a whole bunch of people) killed his successor, Artaxerxes IV, all his children, a whole bunch of satraps, and pretty much anyone he could get his hands on until finally in need of a Great King (because, being a eunuch outside the royal family he couldn't do it) he finally settled on Darius III, Artaxerxes IV's rather lacklustre nephew, who ended up killing Bagoas. So yeah, lots and lots of civil unrest for the Persians. This doesn't mean that Persia didn't do anything. During much of this period the Great Kings were occupied with civil, Egyptian, or eastern concerns, and most diplomacy and campaigning in the west was left to the satraps, mostly Tissaphernes and Pharnabazus. The latter was instrumental, because while Tissaphernes was a good diplomat he lacked military oomph, and Pharnabazus convinced Artaxerxes to put his faith not in Persian armies, but in the fleet. In the aftermath of Agesilaus' invasion of Asia Minor, Pharnabazus, enlisting the support of Conon, an Athenian admiral who spent the rest of his life after the Peloponnesian War on a personal vendetta of revenge against Sparta, wiped the Spartan fleet off the face of the globe, and was able to reclaim not only Asia Minor, but most of the Aegean cities in one stroke, undoing all Agesilaus' saber-waving.