early 13c., "body of persons living under a religious discipline," from Old French ordre "position, estate; rule, regulation; religious order" (11c.), from earlier ordene, from Latin ordinem (nominative ordo) "row, line, rank; series, pattern, arrangement, routine," originally "a row of threads in a loom," from Italic root *ord- "to arrange, arrangement" (source of ordiri "to begin to weave;" compare primordial), which is of uncertain origin but probably from a variant of PIE root *ar- "to fit together."
Meaning "a rank in the (secular) community" is first recorded c. 1300; meaning "command, directive" is first recorded 1540s, from the notion of "to keep in order." Military and honorary orders grew our of the fraternities of Crusader knights. Business and commerce sense is attested from 1837. In natural history, as a classification of living things, it is first recorded 1760. Meaning "condition of a community which is under the rule of law" is from late 15c.
Phrase in order to (1650s) preserves etymological notion of "sequence." The word reflects a medieval notion: "a system of parts subject to certain uniform, established ranks or proportions," and was used of everything from architecture to angels. Old English expressed many of the same ideas with endebyrdnes. In short order "without delay" is from 1834, American English; order of battle is from 1769.