We develop a network model of occupational segregation between social groups divided along gender or racial dimensions, generated by the existence of positive assortative matching among individuals from the same group. If referrals are important for job search, then expected homophily in the structure of job contact networks induces different career choices for individuals from different social groups. This further translates into stable occupational segregation equilibria in the labor market. We derive conditions for wage and unemployment inequality in the segregation equilibria and characterize both the first and the second best social welfare optima. We find that utilitarian socially optimal policies always involve segregation, but that integration policies are justifiable by additional distributional concerns. Our analysis suggests that social interaction through homophilous job referral networks is an important channel for the propagation and persistence of gender and racial inequalities in the labour market, complementary to classical theories such as taste or statistical discrimination.