Does gravity violate the second law of Thermodynamics?
I like your question. In short, no, gravity can’t cantradict the second law–otherwise it would not be a law. If you could prove that it does, that’s nobel laureate material. In effect, gravity can be considered analogous to a compression. Now, when you think of a microstate–keep in mind that’s of the dimension of the state in question, e.g. phase space. For a monoatomic gas, that’s x and p, or six dimensions. Sure, as you crush the gas down, the number of states in x (space) decreases, but the gas now has more collisions, and heats up, which means the states available to p (momentum) increase.