f/8 @ ISO 100 would have given you the same shutter speed, same exposure, but the image would have been much sharper and less noise in the shadows. Cameras are very stupid machines, even good ones. The way I look at it, the camera is there to juggle the variables that you can't, but the more freedom you give it, the greater the chance that it's going to make the wrong decision, like choosing f/32.
Have a look at the effect of diffraction on the lens in question.
Sigma Lens: Zooms - Sigma 70-300mm f/4-5.6 DG Macro APO (Tested) - SLRgear.com! Actually it does quite well for itself even up to f/16, but I wouldn't go any higher unless you're doing macro shots with it and just
have to have that extra DoF.
TAv is your friend on the K-5, because it lets you control the two most important variables, and the camera only has to figure out, "How do I set my ISO to correctly expose this scene?" And thanks to the K-5's low light performance, there's very little drawback if the camera has to go with a high ISO, in this case though, it wouldn't.