The second law of thermodynamics states that the total entropy of a system increases. The key thing to remember is "total entropy of a system". It's perfectly reasonable for the local entropy of part of a system to decrease as long as the total entropy of the entire system increases. In the case of active transport, energy is consumed in the form of ATP molecules.