Siddhartha is the story of a man's spiritual journey during the time that the Gautama Buddha lived.
Siddhartha grew up idolizing the aesthetics and joined the quest to discover Nirvana. The downfall in this for him was the disdain he felt for the "childlike" people who sought materialism and carnal pleasures.
To better understand this other type of life, Siddhartha leaves his simple life to learn from people following different paths through life in the city. He faces the trials and tribulations that his life had been sheltered from ever experiencing before and ultimately realizes that he had to go through it all to be able to truly let go of it and not look down on people not following his path with condescension.
The lesson of Siddhartha is that every person has their own path to follow and that you should be present to the moment and your surroundings and experiences.