I see what the book did but I would agree with your answer.
If you integrate from 0 to 6 you get the 240.
However the units would not be consistent as the spring constant is expressed in lbs/ft. Therefore if you integrated from 0 to 6 the contribution from the spring would be 180 (in^2)lb/foot as opposed to simply ft lbs if you integrate from 0 to 1/2
My only other concern is the weight of the spring. Are you to ignore the weight of the spring or is there additional data you haven't provided?