A.  Because it was a contract that state employees and the state agreed to when each employee was hired.
B.  Because the state was the employer, and this is one of the forms of compensation to which the employees were entitled.

The "state" meaning the people, as represented by their government.