Q.yucca
I live in the coastal Pacific Northwest. My decades-old yuccas bloomed this year as usual. Though the spikes are normal sized, about 4 or 5 feet tall, they seem to be too heavy for the plants, and all are leaning, some to the ground. Is this a consequence of too little water (the other plants in the area don’t seem to be suffering), or inadequate pruning? I thought of cutting the spikes and cutting away the old leaves, in the hope of having better result next year.

Check on the soil moisture. Overly wet soil can cause root rot.
In this case though, I think the flowers are just simply heavy and the plant may need some additional moisture.
This really is quite stunning, even bending down!
Here is a link with some other possible causes.
https://www.gardeningknowhow.com/ornamental/foliage/yucca/droopy-yucca-plants.htm