Energy entropy is a subset of a broader universal "law" that has not been properly enunciated/agreed to.
Entropy is fully defined as being a number proportional to the logarithm of the number of microstates that can replicate the same macrostate. What does this mean?
Well, a microstate is the full, exact description of a particular state. For example, the microstate of a volume of gas consists of the positions and velocities of each and every molecule in the gas.
A macrostate is some measure over these molecules. For a gas, for instance, one can fully define how the gas behaves by just keeping track of a few quantities, such as pressure, temperature, and volume. Because the behavior of the gas is fully specified by these variables, this is what is known as the macrostate.
So, we can then ask the question, which macrostates are more likely? Well, it's just a counting exercise: every single possible set of velocities and positions of air molecules are identical, so we need merely add up the number of specific microstates that determine a particular set of pressure, temperature, and volume parameters. Those states that have more states that can look like them are those that are more probable: they are higher-entropy states.
The second law comes from this simple fact: if we take a group of molecules that is in some low-entropy state, chances are the velocities and positions of each molecule will, with time, end up in a higher-entropy state, just because there are more higher-entropy states to move into.
And basically, what we find when we add gravity to the mix is that collapsed objects have more potential microstates than diffuse objects, so a collapsed state is a higher-entropy state.