Less facetiously, bank robbing is merely one extreme example of something you're not allowed to enter into an agreement to do. You also can't enter an agreement to provide sexual favors for financial compensation, or employ people full time for less than minimum wage, or require someone to donate an organ to you in exchange for financial compensation. None of these are violations of the freedom of association - there's no restriction on the groups you can freely join or leave, there are just certain things that you can't do regardless of the groups you are or aren't in. In right to work jurisdictions, requiring non-union members to pay union agency fees is just one of those things you are not permitted to do, and thus can't enter an agreement to do.
Nobody is being forced - everybody is voluntarily accepting or refusing contracts.