San Francisco and Santa Clara County in California filed a lawsuit Tuesday to block the Trump administration from implementing a new rule that would deny permanent residency to legal immigrants if they are judged likely to use government benefit programs.