What causes diabetes patients to get pain in the legs and feet?

Vascular disease. Diabetes injures the smallest blood vessels in the body. The vascular system is like a tree and the smallest blood vessels are furthest away from the heart. Like the smallest branches are furthest away from the trunk. The feet and lower legs have small blood vessels. When these are damaged the nerves and muscles cannot get proper blood supply, and therefore cannot get oxygen. Thus pain.
Depends on the cause. Your pain could be as a result of many different things. A thorough history and physical exam and possibly some laboratory and radiology exams are needed to determine the exact cause. Causes of pain may include: trauma (fracture, sprain, arthritis), infection, metabolic conditions (gout), musculoskeletal or biomechanical abnormality and neurologic conditions (neuropathy).
Damage to nerves. High sugars increase biochemical pathways in nerve tissue that damage the nerve cells, disturb their function, 'give false messages' to you-eg: pins when none there; heat, but no fire near, etc.