First note: The Federal government has no laws making the collection of rainwater illegal. They do have safety guidelines, but these are suggestions for the safe collection of rainwater and not legal requirements for private individuals. For corporations, the distribution and sales (if any) of course would require they follow all state and federal health code regulations for food distribution that apply for food safety and cleanliness standards the same as any water collection/distribution method.
There are no states where the collection of rainwater is illegal for private individual households, however some states have restrictions on the type of device used and/or the volume of rainwater per household that can be collected. Why they do this varies by state and is usually either due to worries that collection might interfere with local waterways being refilled from nature or residual property rights laws that remain from the early expansion of the country that have not been altered in modern times.
States with No restrictions on rainwater collection for private property*
Alabama
Alaska
Iowa
Kansas
Kentucky
Louisiana
Maine
Mississippi
South Dakota
Vermont
West Virginia
Wisconsin
Wyoming
*Some may have laws regarding long term storage, (Louisiana it must be covered storage) or laws regarding ground water collection (Alaska requires purchase of ground water rights) but that’s not a rainwater collection.