mid-14c., "a distinctive system of beliefs or observances held by a number of persons; a party or school within a religion," from Old French secte, sete "sect, religious community" (14c.) and directly from Late Latin secta "religious group, sect in philosophy or religion," especially a heretical one. This is a special development of Latin secta "manner, mode; following; school of thought; course, system," literally "a way, a road, a beaten path," from fem. of sectus, variant past participle of sequi "follow," from PIE root *sekw- (1) "to follow." General sense of "those of a certain way of thinking or living" is from late 14c.
The notion in the Late Latin development is "those following (someone's) way." But the history of the word seems to be confused with that of Latin secta, fem. past participle of secare "to cut" (from PIE root *sek- "to cut"). The meaning "separately organized religious body, denomination" is recorded from 1570s in a Protestant context and seems to carry more of a notion of a party "cut off" from a main body.
It also was used in Middle English generally of a class of people or things, a species or race, a distinctive costume, sometimes also of sex (perhaps partly by confusion with that word).