Segmental colectomy is primarily performed to treat colorectal cancer. It is also indicated for other conditions such as diverticulitis, Crohn's disease, and severe gastrointestinal bleeding. In the context of cancer, it is used when the disease is localized and can be effectively managed by removing a portion of the colon, as opposed to a total colectomy where the entire colon is removed.