Why is the second electron affinity for oxygen positive instead of negative?
Because you are bringing together two negative charges.
The 1st electron affinity is defined as the enthalpy change for:
There is energy released in bringing in the negative electron up to the positive nucleus.
The 2nd electron affinity is defined as the enthalpy change for:
Because the electron is negatively charged you can see that there will be repulsion between the ion and the electron making the process endothermic, hence the positive value.
The reason why it can happen is that this is just one energy change in a whole series which may occur during a reaction.
It is the net sum of these which decides the overall enthalpy change (