Which states legalized abortions? Do you mean judges legalized it or are you saying that legislatures actually legalized it?
I believe the legislatures did. In fact Reagan was Gov. of CA and signed it there so it must have been there. He did say later that he really regretted it. I don’t know for certain about NY but I think it was also done by the legislature.