The House passed the bill from Gov. Bob Riley's ethics package 52-49 at 2:45 a.m. Wednesday.
It stops public employees from using payroll deductions to pay dues and give political contributions to groups that represent them.
Opponents said states that have passed similar laws have seen membership rolls drop because fewer people will write checks to the organizations.
The bill now goes to the Senate, which passed a similar bill on Friday.
The two chambers must agree on the same version for the bill to become law.