It's not forbidden, it just has a ~10% tariff (fine). $10 per MWh compared to the current price of $120 per MWh. If solar or wind ends up actually cheaper than coal, it'll probably be by more than that 10% so it'll still be economical to use them.
Furthermore, the fine doesn't apply to exported electricity, which is most of it:
"Wyoming sends two-thirds of the electricity it generates to nearby states" [1]
The wholesale price a new American wind farm gets for its output in a region with good resources is maybe $30-$40/MWh. (Or $40-$50 if the wind farm lasts 25 years and collects the federal Production Tax Credit for its first 10 years.) The extra $10 in taxes makes a bigger difference at the wholesale level.
Furthermore, the fine doesn't apply to exported electricity, which is most of it: "Wyoming sends two-thirds of the electricity it generates to nearby states" [1]
[1] https://www.eia.gov/state/analysis.cfm?sid=WY