I used to blame changing specifications from clients for code rot, not realising that business models do change and it's my job to develop in an adaptable way. I now see that as a sign of a bad developer (I've changed!).

But now I see other 'whinges' in myself. A few times recently I've found myself saying 'it's like trying to fit a square peg in a round hole', and also I find myself blaming client indecision for a project not progressing. 

Are there signs I should look out for where I should change my attitude? Is the client always right, or am I sometimes justified in getting frustrated?

I wouldn't say you are bad developer. Being aware of the issues already moves you beyond this definition.

Requirements change. That is a given. A good developer need to take this into account. Many modern programming techniques help coping with that.

Staying true to original spec is not realistic. Also not realistic is changing the requirements all the time.

The client is definitely not always right. It is 'right' more often than we want him/her to be, though (as in, try to accommodate him if he isn't totally off). But when you see him driving the project in the wrong direction, try to advocate for the things you think are right.

There are no hard rules on these things, and even good and experienced developers haven't achieved the perfect 'Zen'. The only wrong approach is not trying to improve on these.
