Why does ATP ranking takes into account how deep players go in tournaments?
Because the further a player goes in a tournament, the greater his achievement is. Reaching more rounds requires beating more players, and generally the quality of the opposition increases with each successive round. If we didn't have such a system, either everyone would receive no points for finishing a "runner up", or they would all receive the same points - in both cases there would be no meaningful way of ranking "non-winners".
At the same time tournaments exist to establish one
single best player. Winning is qualitatively different from coming runner up, because it represents a victory over the field. If it wasn't, then we wouldn't need to have finals at all. We could give the finalists equal points, and they could go home and have a rest.
Because of this, there is a sense in which going deep in tournaments does not make up for a failure to win titles. Djokovic could make the final of every tournament he played, and be the number one in the world, losing every one of those finals to the same group of players. He would be "mathematically" no worse off than he is now, but I think we would struggle to claim he was the best player, and Djokovic and his fans would prefer to exchange going deep in tournaments with actual title wins.