First, Freud's emphasis on sex was part of his overall emphasis on the importance of the subconscious mind. He came to believe that the subconscious was the site of internal conflicts, the resolution of which was crucial to mental health. It was his interactions with his patients (Freud was a practicing psychotherapist) that led him to that conclusion, which he then extrapolated into his complex, yet somewhat reductive understanding of the subconscious driven by the libido. This in turn led him, in Society and its Discontents, to explain society itself as the product of the interaction of people driven by the repression or expression of these urges.
Of course, to successfully navigate society, one needs to be able to repress their urges. Freud's early work was done in late nineteenth-century Vienna, a time when very strict sexual mores prevailed throughout Europe and the United States. (For an important, though somewhat controversial analysis of Freud's intellectual and social milleu, see Carl Schorske, Fin-de-Siecle Vienna: Politics and Culture.) So it does, to some extent, stand to reason that Freud would zero in on sexual energy as the "engine" driving the unconscious. His work with the famous Anna O. was particularly instrumental in forming his wider conclusions.
Finally, we should note that Freud reached many of his conclusions through self-analysis. His understanding of the Oedipal complex, in particular, was based on his memories of his own childhood. Freud's own experiences thus may have shaped his view of the human psyche. In short, Freud was a revolutionary, astonishingly innovative, but he was also a product of his time.