OK as I Pirates fan I can clear this up and explain why it's an excellent move for the Pirates.
Dave Williams is likely going to be pushed out of the rotation this year due to Van Benschoten and Burnett both coming back from injury, so he was expendable. Not to mention we have 5 capable(Burnett, Van Benschoten, Maholm) to great(Perez, Duke) lefty starters and a 6th on the way(Gorzelanny)
We have a 1B who was a late season call up, Brad Eldred. He needs 1 more year in AAA to cut down on his strikeouts, and improve his fielding.
Casey has 1 year left on his contract, so the Pirates will likely trade him at the deadline and call Eldred up for the remander of the season. I think if Casey is having a good year he could fetch something worth much more than Dave Williams.
So in the end this trade gives us time to let Eldred get ready, and will also return, hopefully, another piece more important to us than Dave Williams.
BTW Casey is not overrated in any way. If anything he's underrated.