Does a magnetic field decrease or increase entropy? My question is just the title:
Does a magnetic field decrease or increase the entropy of a system? For example if we apply a magnetic filed to a substance, is the entropy decreased or increased?
 A: Many materials contain microscopic paramagnetic moments which are free to randomly orient themselves in zero magnetic field. If you apply a magnetic field, then the magnetic moments are able to lower their energy by entering a lower entropy state where they are magnetized.
In such a material the entropy tends to decrease as magnetic field increase, at least when it is able to give away entropy to its environment. (If not able, the magnetic moments will get hot instead.)
This effect is important in magnetic refrigeration because the reverse is also true: a paramagnetic material tends to absorb entropy as the field is decreased.
Thermodynamically we find that (this is an example of a Maxwell relation; imagine replacing pressure with $M$ and volume with $B$):
$$
\left(\frac{\partial S}{\partial B}\right)_T = \left(\frac{\partial M}{\partial T}\right)_B
$$
What you can see is that for entropy to change, a material needs to have a temperature-dependent magnetic moment in fixed field. This is definitely the case for paramagnetic moments which have $\left(\frac{\partial M}{\partial T}\right)_B$ negative.
There are however some special cases where $\left(\frac{\partial M}{\partial T}\right)_B$ is instead positive. A good example is a superconductor where decreasing temperature turns on the Meissner effect which opposes the magnetic field. In such materials we have instead that entropy increases when magnetic field is turned on.
