it's possible that when David was conceived it was a heat of the moment thing which didn't allow time for birth control.
I would think that by Trek's time, birth control is as simple as a one-time shot with a hypospray which is forever 100% effective until reversed with another such shot.
Although in the ST III novelization, it is implied that birth control is a simple matter of will (David and Saavik are talking about it and David says something about "I passed all my exams in bio-control").