I'll try to give you a partial answer...
According to Joachim Schildt (section 2.1.3, page 72), in Old High German the finite verb was often on the second position in a sentence but it could also be the first one. In imperative sentences the finite verb was on the first position, for example "gib mir trinkan" ("give me to drink"). In subordinate clauses the finite verb often was on the last position. But generally the position of the finite verb was more free than in modern German.
In Middle High German the situation is similar: in the main clause in most cases on the second position, in imperative sentences first or second position, in subordinate clauses final and other positions. Schildt assumes that in Germanic the finite verb was on the first position in a sentence (section 22.214.171.124, page 95).
Werner König presents some details about socio-linguistic differences in the position of the finite verb in the 15th century. In that time educated writers and public documents used to put the finite verb on the final position of a subordinate clause whereas less educated writers and private letters do so less (p. 83). In the 16th and 17th century grammarians declare this final position compulsary (p. 100).
Various scholars point out that historical syntax is hard to reconstruct: ancient texts (at least Old High German ones) are in verse (which means there is no natural syntax) or they are heavily influenced by Medieval Latin (which means the syntax might be Latin too).
In Old Norse the finite verb usually was on the second position or on the first one, also in non-questions (Haugen, section 16.2.1, page 248).
The initial question was, which of the two (V2 or V-final) is oldest -- may be none of them (see Schildt). And why did V-final take over the subordinate clauses -- well... probably no linguist knows that for sure.
- Joachim Schildt: "Abriß der Geschichte der deutschen Sprache", Akademie-Verlag, Berlin 1984
- Odd Einar Haugen: "Grunnbok i norrønt språk", Ad Notam Gyldendal, Oslo, 2. utgåve 1995, ISBN 82-417-0506-9
- Werner König: "dtv-Atlas zur deutschen Sprache" (dtv-Atlas Nr. 3025), 10. Auflage, München 1994, ISBN 3-423-03025-9