In my old school on another country we do have this and it's compulsory. It was done like that because that country's population is rapidly increasing, not to mention unwanted pregnancies, diseases, and stuff.
It was funny though, first day we did in SexEd class was to write on the board everything that comes to our mind when we think of the word 'Sex'. We got some weird answers haha.
In Ireland it's still getting passed and I think it's going to be optional if the parents would let the child attend or what.