Why is everyone suggested to specialize their education? Why is so common to suggest university students to specialize in order to get a better paid job?

This goes completely against the principle of diversification of investments, in order to decrease risk by spreading it over a portfolio.

Instead, students are driven towards specialization, investing their most valuable asset, time, in a single high risk endeavor. Specialization might be good for society as a whole, but can have disastrous consequences for the individual.
Note: I did not vote down on this question, and it is not clear why anyone would do so.


  Why is so common to suggest university students to specialize in order
  to get a better paid job?


Because the industry evolves and encounters increasingly harder, diverse challenges. Specialized knowledge is essential for coping with those challenges. At the same time, it is impossible for everybody to achieve expertise in all the diverse disciplines or branches of knowledge. In the labor market, that implies that the supply of workforce is more constrained as we move along the "specialization axis". 

It is noteworthy, though, that specializing in order to get a higher compensation is not always profitable. For specialization to be profitable, there also needs to exist enough demand for a skills set. A specialist in semantics of Etruscan dialects spoken in the Po Valley will have a much harder time to find a job in his field (let alone to earn a satisfactory salary) than a specialist in 4th generation nuclear reactors.


  students are driven towards specialization, investing their most
  valuable asset, time, in a single high risk endeavor.


Not really. A certain extent of diversification is inherent to the individual's university background. In the case of the nuclear reactor specialist, his background includes calculus, probability, numerical analysis, thermodynamics, heat transfer, electricity, etc. That background makes it easier for him to adapt to drastic changes such as switching careers. 

By contrast, a company is much more static and, thus, much unlikelier to cope with drastic changes successfully. Here are some factors that impair a company's adaptability:


Managers, first and foremost, aim at retaining their power;
it is harder for various stakeholders to agree on what the new
direction needs to be;
synchronizing an update of skills set of all its members is expensive
and possibly out of reach;
some members of the organization might leave during the transition;
new processes might entail new redundancies, frictions, and
additional overhead.


A shareholder has little-to-no control on how the company will fare, or whether it will adopt a unified, effective approach at all. Things are different with the individual, provided that he is determined, not erratic, and has a rational/realistic vision of what he wants.