Some Elves lived in trees others had a greater affinity for caves. Why was this?
As for Elves living in caves, i can only recall the Noldor in Nargothrond and the Sindar in Menegroth.
The ones in Nargothrond lived there because it proved a fine stronghold, and a good hiding place from Morgoth, whilst Menegroth was also a fine stronghold but most importantly a fitting place for a city. Now that i think of it, Thranduil has a city underground as well. Again, fine stronghold, as dragons and spiders and Dol Guldur weren't that far away.
Elves living in trees, would be the Galadhrim. I find it quite logical if you live in forests, to live up in the trees... provides best protection against Orcs and such nasties.
Could it also depend on where the elves were when they awoke and where they ended up if they got lost travelling to the Undying Lands?
Nope, as all first Elves (144, according to HOME) awoke at Cuivienen.
Back in Middle Earth, those elves who remained seemed to live either in trees or caves. Maybe they again missed out on Aule's lessons, or maybe preferred something more natural.
The Noldor who stayed in Middle-Earth after the First Age, lived either in Lindon or Hollin. In Hollin a great city was built, Ost-in-Edhil, who was later demolished by Sauron, but of course during the war in 2nd age Rivendell was founded. As for Lindon, i have no idea where or how Gil-Galad lived over there. Probably near Círdan in Mithlond, anyway after the 2nd age the only Elvish settlement in Eriador would be Rivendell, and the Grey Havens/remains of Lindon.
The Galadhrim and Silvan Elves and others who are related to the Nandor, never came to Valinor so could've never been taught by Aulë anyway.
I think Thranduil's underground city is mostly out of safety, otherwise he would have lived in the trees as well... like the Galadhrim, who had of course the Power of Nenya to keep all intruders out.
The Elves chose their settlements mostly out of safety, at least in Middle-Earth. In Valinor, they could chose more esthetically.
Give up the Halfring, she-elf...