Pain from one area of the body can be referred to another part of the body.Back pain can be caused by the hip. The opposite is true, too: hip pain can be caused by a problem in the spine.
Sometimes the pain is close by but at other times it can travel far away from the source. A standard rule of thumb for any part of the body is to check for problems at least one level above and below the site of pain.
There are special tests that can be done to find out where pain is really coming from. For example rotating the hip inward can help screen for problems coming from the hip. Likewise, bending the hip and knee and putting pressure through the hip can help identify back versus hip pain. Your doctor has probably used these tests to come to this diagnosis.
The final proof will be in treating the hip. Expect to see your back pain go away by improving hip motion and function.