The idea is not that we pray for the pope, but that we pray for the pope’s intentions.
The pope has official intentions every month. (You don’t have to know specifically what they are, in order to get the indulgence, though it’s nice to know.) The connection with indulgences allows him to get various important things prayed for by millions of the faithful in force, every month.
But the major thing is that indulgences are supposed to be granted by Jesus to come from the merits of the Church as a whole, So having all the Church members wanting indulgences out there praying for the intentions of the earthly vicar of the Church is fitting. We are all together in this, that way.