Having left the Semanas and his friend Govinda, Siddhartha realizes he must be in the world before he can be removed from it: to look at a beautiful woman without lowering his eyes, to shave his beard and comb his hair with oil, to buy and wear fine clothing, and to learn the ways of eros (physical love) from a master teacher, Kamala.
Siddhartha realizes that he cannot attain nirvana without first being like others: to ply a trade, to love a woman, to use money. A monk, the Buddha, or the Semanas live protected and sheltered lives, so how can they attain peace if they have never been in the material world, or be tempted by love and money? How can they give up what they have never had? To do otherwise would be hypocritical and false.
Kamala is not just a prostitute or a means to an end. She teaches Siddhartha to be an individual. Ironically, Kamala knows him better than Govinda, his shadow, because she can complement him as a mate and mother-figure. He says to Kamala:
"You are like me; you are different from other people. You are Kamala and no one else, and within you there is a stillness and sanctuary to which you can retreat any time and be yourself, just as I can. Few people have that capacity and yet everyone could have it."
Siddhartha goes through Kamala's garden as a gateway to giving these material possessions up later. He must know what sex and money are before he becomes an ascetic. Otherwise, they are mere abstractions, not real sources of temptation.
Also, Siddhartha sees his future in this chapter: he crosses the river with the aid of the ferryman. He too will become a ferryman; it is the perfect job for him: in nature, by the river, helping others, humbling physical labor. This chapter, the middle of the book, foreshadows his attaining nirvana by the river at the end.