Several Connecticut environment groups and companies are taking the state to federal court over the legislature’s decision to remove money from state energy funds in the two-year budget passed in October. The Connecticut Fund for the Environment and 11 other plaintiffs filed a lawsuit in the U.S. District Court Tuesday in order to stop the $165 million sweep.Using the funding for other than its intended purpose is a breach of the contracts clause of the United States Constitution, the plaintiffs argue. Much of the money is raised through a small surcharge on electric bills; because the money is now allocated for different purposes, the plaintiffs say this qualifies as an illegal tax on tax-exempt organizations — such as nonprofits that are ratepayers.