Why does positive phase and gain margins cause any system to be stable whereas negative phase and gain margins cause the system to be unstable ?
This is linked to the Nyquist stability criterion, which comes down to the number of encirclements of the minus one point of the open-loop in the Nyquist diagram. Namely the number of unstable closed-loop poles will be equal to the number open-loop unstable poles minus the number of counterclockwise encirclements of the minus one point.
A negative phase margin means that you enter the unit disk, with the minus one point to your right (which is a part of a clockwise encirclement of the minus one point). You can only prevent an encirclement by decreasing in phase and go to the positive real axis outside the unit disk, to close the loop from the Nyquist contour, if you add unstable poles to the open-loop system. Adding this also still makes the closed-loop unstable. However the opposite does not have to be true, that positive phase margin means that the closed-loop will be stable. Namely when the open-loop system is unstable it is possible to have positive phase margin, while the closed-loop system is unstable. So positive phase margin is necessary but not sufficient for closed-loop stability.
I am not sure if a negative gain margin has any practical meaning, because multiplying by a negative number also induces 180° of phase shift. So in order to identity such a margin you need to find a crossing of a multiple of 360°. You can get that the closed-loop will become unstable when you multiply the open-loop by a negative number, however the existence of a negative gain margin does not mean that the closed-loop will be unstable.