Lymphadenectomy is primarily performed for staging and therapeutic purposes. Staging helps determine the extent of cancer spread, which is crucial for planning treatment. Therapeutically, removing lymph nodes that contain cancer can help control the disease and improve prognosis.