Wilhelm, throughout the book, longs for freedom. He does not know it when the book begins but, on the day in which the book's narrative action occurs, he will achieve such "freedom."
To answer this question one must answer what it means to be free, at least within the context of the novel. Tamkin claims, in Chapter IV, that man is tied down by social control, egotism, vanity, and most importantly by the conflict between the "pretender soul" and the true soul. The "pretender soul," continues Tamkin, is attached to social control. Moreover, although Tamkin's language is mocked in many ways, Tamkin is nevertheless expressing some kind of truth. To use Tamkin's words, to be free, Tommy must free himself of his mask, allow his true soul to replace the "pretender."
Furthermore, to do this, Wilhelm must stop playing the "roles" he has been holed into and he must find the person that he really is. For instance, throughout the book, he is seen, and sees himself, as "Dr. Adler's son." Dr. Adler needs to abandon him for him to unlatch himself from his role as his father's son. Later, Tommy becomes attached to Tamkin and the same disatachment is necessary. He needs also to release himself from money's grip and so he must lose all of his money to unhinge its leash. Further still, he needs to release himself from Margaret, not from his obligations as a father, but from his victimization of her. In short, the paradox lies in the fact that one must lose everything in order to be free.
The other and final element that frees Tommy is that of love. Once Tommy knows who he is than he can find solidarity with the rest of society and become part of the "larger body" of humanity, instead of always being isolated in the crowd. In the end Tommy feels love for the people around him, as in Times Square, and he feels love for the stranger in the coffin. It is a beautiful irony that the self-same society that constricted him can, in the end, be a freeing force also.