Rotavating can, over time, create a hard pan underneath the depth to which rotavation always occurs - through which water can find it difficult to drain.
The traditional solution is to add organic matter to improve both water retention on free draining soils, and to improve drainage on water retentive soils. Sounds counter-intuitive, but that's what I was taught at horticultural college so I believe they know their onions, so to speak!
Also, always avoid standing on soil or working it if it sticks to your boots. You compact it and prevent proper drainage.
Raised beds are always an option if the soil is permanently waterlogged and/or you have a high water table but I wouldn't necessarily go that route first.