Siddhartha thinks this as he works on the river, still feeling deeply the wound of losing his son and wishing he could find him. He has grown wiser, but he is not yet fully wise.
The quote indicates that Siddhartha is still in a state of desiring and a state of separateness from others. He is more and more perceiving his oneness with the people he ferries, and he is understanding and loving them with a greater compassion now as he realizes how he is like them. Yet at the same time, his wound remains. In the quote above, he expresses feeling sorry for himself because it seems unfair to him that other people—even bad people—get to be with their children, to be loved by them and to love them. He can't understand why he can't participate in this. Seeing others with their children so often rubs at his wound.
After trying to find his son, having a vision of his father, and understanding that his father felt the pain of losing him just as he feels the pain of losing his own son, Siddhartha is even closer to oneness, but he still feels the wound of separation. Finally, he opens up to Vasudeva, who tells him to listen to the river. At last, Siddhartha experiences his revelation:
In this hour, Siddhartha stopped fighting his fate, stopped suffering. On his face flourished the cheerfulness of a knowledge, which is no longer opposed by any will, which knows perfection, which is in agreement with the flow of events, with the current of life, full of sympathy for the pain of others, full of sympathy for the pleasure of others, devoted to the flow, belonging to the oneness.
The quote about longing for his child shows that giving up the desire for his son as well as the sense of separation from him is an important step in his achieving oneness with the universe. Only that oneness allows him to stop suffering from his wound.