Why was Satan in the Garden of Eden? Why was evil in paradise in the first place?
While mankind had not yet fallen, the angels had already been given a choice to serve God in his kingdom. A good number of them didn’t. Satan was their leader, and he and the other disobedient angels were banished from heaven. This is how he came to be on the Earth.
For more on this subject, see our answer to the question, “If Adam and Eve were the first persons God created, where did the devil in the Garden of Eden come from?”