Why wouldn't they just take one measurement and go with it? Well, for some problems its through repeated use that things become worse. You're not gonna get a job that asks you to bend over once a day and it be a part of your job that matters. But they aren't gonna ask you to bend over for an hour to find out your disability level, that's just silly. So if they can see that after 3 movements it becomes worse, usually due to instinctive guarding tendencies, they can see that is close to your actual disability. Why they rate off where the pain starts not where the movement ends. There are ways to justify higher ratings from functional loss, but they take more paperwork and history than the C&P exam has time for.
I believe it comes out of a court case, DeLuca v Brown, that said VA has to take in account repetitive use in deciding their claims. Now the RO is supposed to get an overall picture of your disability, from C&P exams and medical notes. So there is some room for them to say the 40 degrees is a more accurate picture if that is the measurement that showed up more often, I've heard of that. I'd say that would be good for a VA appeal though.
Here's a snippet I found from a GOA report going over the VA's compliance with DeLuca:
Under VA’s quality review standards, a joint or spine exam report satisfies the DeLuca “repetitive use” criteria if the exam report indicates the extent, if any, and the number of degrees, if possible, to which range of motion is additionally limited by pain, fatigue, weakness, or lack of endurance following repetitive use. The additional functional loss may be stated in terms of either degrees of loss of motion or the additional percentage of loss of motion.