In addition to The Abyss's post, budget also played a part.
IIRC some formats were significantly more expensive than others to use.
From memory a lot of the differences are from even before TV, but from competing studio and camera/film companies, but it accelerated when TV started to be seen as a threat to the cinema.
As an odd aside there are a few films where they change aspect ratio repeatedly, usually as a way to get a "historic" feel, so for shots set in say the 40's they'll use one ration, for shots in the 60's they'll use another and for shots in the 90's another.
I think there are is also an element of certain aspect ratios work better with certain types of film, so something that is meant to be "epic" or give the impression of being in a wide open space a very wide angle ratio might be used, whilst for something that is meant to be more claustrophobic a narrower one as you may not notice it consciously but the brain picks up on it.
Some movies even changes half way through !
Yup, iirc there are a few that change constantly throughout the film for "flashback" shots.