State lawmakers gave final approval Monday to a bill that will end capital punishment in Virginia, a dramatic turnaround for a state that has executed more people in its history than any other.