Court tears down housing law that densified single family neighborhoods