It keeps legitimate businesses from pestering you.
It does not prevent scammers from pestering you - they have no interest in obeying the law anyway, and their caller ID info is spoofed anyway so the odds of being caught and fined are fairly small :(.