Rickets is primarily caused by a deficiency of vitamin D which is essential for calcium absorption and bone development