order of alphabet possibly purely arbitrary

An additional question is when and why did it become necessary to impose an order, turning the set of letters into a particular sequence? Was it to provide a standard way of teaching, or to provide a standard order for inventories of some kind (early pigeon loft directories perhaps?)
Rod