Lawmakers voted Thursday to cut funding for cities and towns that refuse to comply with federal immigration laws as they debated how to respond to the fatal shooting of a young woman in San Francisco in which the suspect had been deported to Mexico five times.