I have seen some tenured professors at top ranked universities move to lower ranked universities. Why do professors do this? At lower ranked universities there are less resources and the graduate students are weaker.
There are many reasons that people change institutions. I was tenured at an R1 institution and moved to a "high research" institution because I wanted to live in the area where the second institution is located. Although my current institution has a lower research ranking, it is the state's flagship school, where my former institution is not. So, I actually get more resources, better pay, and our students are more prepared when they start college, compared to my prior institution. So, your assumption that a higher ranked institution is better is not always true.
Another reason to add to the list: A university that wants to grow a department (including in reputation) has to start somewhere. That somewhere may be by headhunting talent. They have considerable leeway in salary and more in other resources: promising a million gold pieces to set up your lab, 3 postdocs and no teaching for 5 years would be quite attractive.
Another relatively common reason to move is the working culture of the University, which is not completely correlated to any ranking system.
Some departments of top institutions have a rather solitary culture, while others are outright toxic and dysfunctional to a shocking extent (some stays because they thrive on the terribleness, or the prestige is just so valuable to them that they endure anyway).
A different version is a culture of "busyness", where everyone is constantly laser-focused on amassing massive piles of publications to the extent that absolutely nothing else can matter if you are going to keep up. And the pace is continual and eternal, with some institutions making a point to show how even their post-tenure professors late in their careers still produce massive volumes of research each and every year. Some people thrive on the constant workload, while others are happy to do their few years and get the heck out, ranking-be-damned. I've talked with people who've chosen to stay and chosen to get out, and I can see how it's ultimately a difficult personal value judgement either way.
One final example: many institutions are so proud of their prestige that they consider the opportunity to be there payment enough, and actually support their faculty and students less than other institutions. I've seen very prestigious institutions actually offer lower pay, smaller startup packages, more meager student stipends, and less administrative support than supposedly lower-ranked institutions (usually the other places were still R1).
In short: don't assume that being on top of the pile is automatically a nicer place to be!
While I'm a student, not a professor, I can give you my reasons for choosing the university I did rather than one of the "top-ranked" ones I could have attended.
1) I'm 20 minutes from great skiing, hiking, mountain biking, &c.
2) I can afford a house with large garden, and a place to keep my horse.
3) When I drive to school, I am almost never stuck in traffic moving less than the speed limit.
I'm surprised no one mentioned that: even a highly ranked university need not have a strong research group in every area (in fact, it seems rather implausible).
I imagine people can often choose their university based on where there is a group that does research they are themselves interested in. I suppose this is can be particularly pronounced when your research interests shift.
A friend of mine (a PhD student like me) spent about a year on an internship in a different university. The money he got was significantly better, and the institute he was at is much stronger in general, but he complained to me all the time about having no one there who does model theory.
It may be a trade-off, but there are always trade-offs, lots of them.