Before suggesting some actual answers to the question, I will point out two contrasting opinions that essentially strengthen the question, by answering (in one form or another) ein hachi nami:
Rabbeinu Manoach (quoted in Beit Yosef Orach Chaim 67) says that the reason we don't repeat berachot miderabannan (i.e. why we apply safek berachot lehakel) is because of the need to be stringent on lo tisa.
In contrast, Peri Chadash Orach Chaim 67 writes, based on this question, that it must be that beracha levatala in only forbidden miderabannan, as otherwise we wouldn't need to have a rule of safek berachot lehakel.
If we want to accept (unlike Peri Chadash) that beracha levatala is forbidden mideoraita, but also want to undertand (unlike Rabbeinu Manoach) that safek berachot lehakel is not simply a corollary of the need to be stringent on lo tisa, then Penei Yehoshua to Berachot 12a has a couple of points which are relevant:
דלא מקרי נמי ברכה לבטלה כיון שרוצה להסתלק מן הספק ואשכחן טובא שחכמים עצמן תקנו כמה ברכות על הספק ולא הוי ברכה לבטלה:
[Repeating a beracha out of doubt] is not called a 'blessing in vain' as he wants to remove himself from a status of doubt. We find many times that the Sages themselves enacted to say blessings out of doubt and it is not a blessing in vain.
While he does not say this explicitly with reference to those that hold that beracha levatala is a problem mideoraita, my sense from the piece is that he thinks that this reason applies equally well according to that understanding, and, I think that logically this should be true.
Alternatively, he later suggests:
דהא לכ"ע יכול לברך בלא הזכרת שם אלא בלשון תרגום ובכה"ג לא שייך איסורא דלא תשא ואפ"ה יצא שפיר ידי ברכה
According to everyone [in a case of doubt] he could make the blessing, but only mention G-d's Name in translation. [Reciting a blessing] in such a manner involves no prohibition of reciting G-d's Name in vain, but he does nevertheless fulfill his obligation to make a blessing.
To summarize, two possible approaches as to why we still need the principle of safek berachot lehakel if beracha levatala is forbidden mideoraita:
Repeating a beracha out of doubt is not classified as a beracha levatala / mentioning G-d's Name in vain.
If one did have to repeat a beracha out of doubt, one could do so utilizing a translation of G-d's Name, and thus not say G-d's Name in vain.