First of all,the Persians wanted to expand into Europe,and Greece would seem the first step for such a plan.
But the main reason was the Ionian Revolts.Around 550 BC,Cyrus I,the emperor of Persia,conquered the territory of Ionia(the west coast of modern day Turkey).The city states established there,were Greek,and Greeks considered them the most prominent in the Greek world actually.The people of Ionia were not happy that they had been conquered.
Around 500 BC,Artaphrenes, ruler of the western capital of Persia (Sardis),met with various leaders of Ionia,and made an agreement with them not to attack newly established Persian soil.But Aristagoras, the ruler of the Ionian city Miletus,had other ideas,and yearned control of the city of Naxus.Knowing that Artaphrenes would punish him for breaking the agreement,he incited a rebellion.Aristagoras also knew that the local Greek population would respond positively,and so they did,ousting the Persian leaders.He was aware that it would not be long until Darius retaliated,so he traveled to Sparta and appealed to King Cleomenes for aid. When the Spartan leader learned of the distance his army would travel to reinforce the Ionians, he declined the request for aid.
Aristagoras was in really bad position and desperate for support.Thus,he went to Athens for help.The Athenians,fearing an inevitable attack by the Persians,supported Aristagoras with twenty triremes along with five from Eretria.Then,the Greek fleet sailed to Ephesus in 498 BC.The Allied Greek force marched into the city where they met little resistance. As they marched deeper into the city, they finally engaged Artaphrenes (ruler of Sardis) who was defending the citadel. Not able to capture the citadel, the Ionians set the city ablaze and retreated to Ephesus.Persian troops in the area met the Greeks at Ephesus and massacred most of them. The remaining Greeks scattered to the surrounding cities.
Despite the great setback of losing so many men, Aristagoras continued his fight against Persia.He encouraged more revolts in Western Asia Minor, Thrace and Cyprus.He sent part of his fleet to aid the Cypriots,but the Persians thoroughly defeated the Cypriot army.Darius I decided to attack Caria, a city with close ties to Miletus,Aristagora's city of command and city that he was born.When the Carians learned of this plan, they ambushed the Persian army at night and annihilated it. Four Persian generals died in the battle. Although their deaths were a great loss, Persia continued to reclaim cities.
Seeing his rebellion collapsing,Aristagoras fled to Mycrinus.Frustrated with the failed rebellion,he tried to attack the Thracians but in time he was cut off and destroyed.
After Aristagoras left Miletus (where he gave command to Pythagoras before fleeing to Mycrinus),the Persian fleet sailed to Lade and destroyed the Greek fleet defending the city. Darius and his army captured Miletus in BC 494. After the city-state fell, the revolts in the Persian Empire crumbled, due to a lack of leadership.This failed rebellion made Greece the next target of the Persian Empire,since the revolt was supported by mainland Greeks too.
Tl;dr Persians occupy Greek lands in Asia Minor,the Greeks are not happy about this and one Greek general by the name of Aristagoras incited a revolt against the Persians backed up by other Greeks from mainland Greece.The revolt fails,and now Persians find the perfect "excuse" to invade Greece.