Coffee grounds have a consistent texture that makes them feel like they're at room temperature; they're marketed to you as such, anyway.
This implies that they should be able to live on the counter or in the pantry. However, for some, freezing coffee is the best option.
The most scientific conclusion is to store coffee at room temperature. But, the reasoning behind storing coffee in the freezer is to preserve scent rather than for longevity.
Chemist Christopher Hendon mentioned the molecular basis behind freezing coffee in his 2017 talk at an annual coffee conference.
According to the Arrhenius equation, for every 10-degree Celsius increase in temperature, the reaction rate doubles.
Similarly, every 10-degree Celsius fall in temperature reduces the response rate by half, thus keeping coffee cool will keep the smell.
There's a proper and improper way to keep coffee in the fridge or freezer. Linne suggests storing beans in a Tupperware or Mason jar to prevent them from getting wet.
Linne claims that pre-ground coffee is incredibly dry. Because moisture attracts dry objects, keeping ground coffee in the freezer incorrectly might hasten its spoilage.