There is indeed a repulsive force between the phosphates in the DNA backbone. (The pK of the phosphate is very low so it will be ionised at all physiologically-relevant pH.) This is why DNA behaves like a stiff rod over short distances. However cations in solution will help to shield some of this repulsion. This is why DNA melting temperature decreases as the ionic strength of the buffer is reduced (by increasing the repulsive force relative to the favourable energy term coming from the base-pairing).
When DNA is condensed these repulsive forces are masked by cations like spermine, and of course by histones.