It is easy to see that double helix formation decreases entropy, as the two joined strands are contrained to move together. However, the reaction is spontaneous due to the release of Heat, about -250 mJ ! (see Chemical energetics)
Acid-base reactions that remove or donate protons at specific positions on the DNA bases can disrupt the double helix. Therfore, at pH above 9-10, and below about 5, DNA separates back into its single stranded form.