1. The 24x36 format for 135 film came because the camera manufacturer wanted to use the 135 film stock used by movie industry
The 135 film roll only sets one dimension, roughly 24mm dimension across the roll (once room is left for frame numbers); it can be and is used with various lengths "along the roll", such as the roughly 24x18mm of early motion picture formats. So why mostly 36mm for stills?
a) When Barnack was designing the first Leica cameras, he decided that the frame needed to be bigger than 24x18mm movie frame to get acceptable image quality, and doubling from 18 to 36 [edit: 8 perforations as Petrus points out] was one easy option.
b) But other shapes were tried at times and 36x24mm mostly won out, so again, why?
My guess is that 3:2 was at the wide end of the popular shape range, so all the other options tried were narrower (EDIT: 7 perforations for about 32x24 was one, IIRC) and so those shapes could be got with a horizontal crop. Using instead a shape like 32x24 meant that when you wanted the wider 3:2 shape, you cropped vertically, so got a smaller frame.
One quirk with this history is that for many decades, most prints from 36x24mm frames were cropped to less wide shapes: 5"x4", 5"x3 1/2", 7" x 5", 10" x 8", etc.
2. The 60x60 was convenient for TLR. The base stock was 60mm wide and square format would need no rotation
I agree about the role of the TLR origin, and before that, some of the first medium format cameras, Kodak Brownies, used a square frame for similar reasons.
A minor correction: "6x6" format is actually 56x56mm (coming from something like 2 1/4" wide roll designed by Kodak): names like 6x6, 6x7 etc. come from rounding up to the nearest cm.