The theorem holds not for arbitrary dynamical systems but under two conditions:
1) The flow preserves volume
2) All orbits are bounded.
The second law of thermodynamics is in a sense a statement about evolution of probability distributions. As time goes on the dynamical system mixes any probability distribution such that entropy increases. Poincare recurrence is a part of this mixing phenomenon.