Suppose you have some weightless elastic strip and two weights of equal mass $M/2$. You arrange the weights in two different ways:
In the strip on the left the tensions in the two halves of the strip are different because the upper half is stretched by both weights while the lower half is stretched by just a single weight.
In the strip on the right the whole strip has the same tension.
Since the stretching of the strips is proportional to the tension there is no reason to suppose the overall stretching of the strips will be the same, and indeed it isn't.
If we now take the strip on the left and keep halving the weights so there are four, then eight, then sixteen, and so on weights spread out evenly along the strip we approach the massive rod in your question. The massive rod is conceptually an infinite array of weights spread out along its length. By contrast the weightless rod being pulled at the end is like the strip with all the weight concentrated at the end.
It should be intuitively obvious why the extensions of the rods are different, but intuitively obvious does not constitite a proof. If I were marking this question I would expect you to derive an equation for the total stretching of the rod under its own weight. You would do this by considering the extension of a small element of length $dx$ due to the weight of the part of the rod below it. The total stretching would then be given by integrating.