We have characterized the temperature dependence of the flux threading dc SQUIDs cooled to millikelvin temperatures. The flux increases as 1/T as temperature is lowered; moreover, the flux change is proportional to the density of trapped vortices. The data is compatible with the thermal polarization of surface spins in the trapped fields of the vortices. In the absence of trapped flux, we observe evidence of spin-glass freezing at low temperature. These results suggest an explanation for the universal 1/f flux noise in SQUIDs and superconducting qubits.