Sunlight, heat, and dampness/water, are the conditions that will cause hay to degrade and/or spoil.
If hay is stored indoors where there's temperature control (AC for warmer months), it's usually not a problem to store the hay in a plastic bag with the top left semi open for airflow, or in an uncovered plastic bin. A larger bin that allows some airflow around the bale is ideal. That said, I have stored hay in a covered bin with regular rotation of the hay stored in it, but I also live in a dry semi desert environment with very low humidity.
In higher humidity areas, storing hay in more breathable containers is usually necessary if it's stored outdoors, or if stored indoors without AC to help reduce the humidity in the home.
Good airflow wherever it's stored, is key. And if you ever notice or suspect mold growth, toss the hay, it's not worth the risk of continuing to feed it. Moldy hay should never be fed to rabbits, as it may cause severe illness and possible death.
Other important aspects in storing hay, is protecting it from direct sunlight, protecting it from contamination by little critters, and if possible, to store in a cooler area, but one that isn't damp.
https://wabbitwiki.com/wiki/Hay