Why might my doctor have asked me to sign a pain contract?

Medicine management. Pain contract or opioid agreement or contract is essentially committing to an understanding by the patient that he or she will abide by the rules set forth by the treating physician regarding use of controlled substances. It requires the patient to take medicine as prescribed, not to self-medicate, submit to urine screening, etc. It's not an uncommon practice in chronic pain management setting.
Pain contract. Very important for doctor and patient. For the patient it shows commitment to get better and that you are serious about your care. For the doctor draws the rules of engagement to which the to two of you will conduct patient care. Also makes you aware of the fact that he is serious about how pain medications are dispensed and use by the patient. It is a standard of care.