It was mostly the right-wing parties (CDA and VVD) that wanted to ban squatting. No idea why they didn't succeed in banning it during the 1980s. From what I read about the history, I can't find anything about a law that explicitly allowed it; it seems it was simply the high court that didn't consider it breaking and entering when it was in a building that wasn't being used, presumably considered a building unused when it hadn't been in use for a year, and anyone living in a house for some time got the same legal protection as a legal tenant.
Conservative parties considered this a loophole in the law, progressive parties probably thought this worked quite well to prevent housing speculation.
But it appears it may have originated from a legal accident rather than explicit legislation. Still, during the 1990s it was explicit policy at least in Amsterdam to tolerate squatting within these conditions.