I imagine that registered studies that are completed are published if they have positive results, or negative results that contradict other well-known positive results. There's no reason not to publish if you get a good or interesting result. But publication can take years, so I don't think it's particularly unusual to see a completed study without a corresponding publication.
But again, the specific cases you linked predate the current registration and reporting requirements.
1) Research is carried out by academics with no ties to phamaceutical companies. 2) The negative results make a competitors drug look even worse.
If neither of these things are true, then negative results just sit in a file-drawer somewhere. Compulsory registration (clinicaltrials.gov) will help with this for new medicines, but this will take years before we have any decent information