Rankings can be useful, but you need to take them with a big grain of salt. Apply a +/-15 to them. Schools love to talk about how useless rankings are but brag that they are ranked highly.
One of the most important reasons why schools care about rankings is that the rankings help attract students. At a higher ranked program, your peers will generally be stronger. You will learn more from them, and they will form the core of your future professional network.
Prestige and reputation can be important if you move into a career outside your graduate training. Many graduates will not continue in chemistry or science. For example, if you move on to a career in patent law, it will be generally more helpful to have attended a big name school than a less recognized school with a strong program in subdiscipline X.
If you intend to make your career in a certain location, it can be more beneficial to attend the state flagship than a higher ranked school far away.