RALEIGH, N.C. — Sparked by backlash to Charlotte’s ordinance allowing transgender people to use restrooms aligned with their gender identity, the North Carolina legislature reined in local governments with a broad bill the prevents cities and counties from passing their own anti-discrimination rules.