The 6-3 ruling reinstates a law that told libraries to install filters or surrender federal money .