You may have cauda equina syndrome. I recommend you be examined urgently by a neurologist. You should have an X-ray of your spine.
The possible causes of cauda equina syndrome include a herniated disc, a ruptured intradural disc, spinal stenosis, injury, or a tumor.
If you have questions please ask me.
According to your question you recently experienced back pain which was immediately followed by the urge to defecate ("my back started hurting and then I had to have a bowel movement. . . . . . .happened again."). If you are having pain in your back immediately followed by a bowel movement then it is reasonable to assume that the two are related----pain in back (spine) -----> loss of muscle control in rectum ---> fecal urgency = cauda equina syndrome.
Your problem can only be assessed by viewing the X-rays and/or an MRI of your lower spine.
The cauda equina is the lower part of the spinal cord which contains the nerve roots which send and receive messages to and from the colorectal area of the body. The cauda equina is formed by nerve roots caudal (at or near the tail) to the level of spinal cord termination. Cauda equina syndrome has been defined as low back pain and variable lower extremity motor and sensory loss. A patient with cauda equina syndrome often presents with nonspecific symptoms with back pain the most significant and dramatic. Occasionally they will have a history of incontinence.
Progressive cauda equina syndrome beginning in the second or third decade with lesions in the lumbosacral region can produce fecal urgency.
There may be another cause for your symptoms of back pain followed by fecal urgency; however, it is my duty to recommend that you have an X-ray of your lower spine to rule out the possibility of cauda equina syndrome. It is medically negligent for a physician not to X-ray a patient with your symptoms.
As I told you previously, you need an X-ray and/or an MRI of your lower back to rule out cauda equina syndrome.