Rickets is primarily caused by a deficiency in vitamin D, which is crucial for calcium absorption in the gut. Without sufficient vitamin D, children's bones can become soft and weak, leading to skeletal deformities. Poor dietary intake, lack of sunlight exposure, and certain medical conditions can all contribute to vitamin D deficiency.