Notice you don't need the same verb to use this structure. Other constructions using different verbs would also call for the subjunctive. Consider the following extract from a book:
Haga frío o calor, llueva o haga sol, el ejercicio antes de una comida es bueno para la salud.
In this sentence, the subordinates "haga frío o calor" and "llueva o haga sol" can be thought of as subordinadas adverbiales concesivas, thus requiring the subjunctive. Subordinadas concesivas are subordinates that pose an obstacle to what is expressed in the main clause, while not completely preventing the action. The English equivalent would be clauses introduced by despite, regardless of, even though or albeit. If what is being expressed in the subordinate clause is hypothetical or unspecified, you need the subjunctive.
While most subordinadas adverbiales concesivas are introduced by aunque or a pesar de (que), you could rephrase the sentence above as:
Aunque haga frío, aunque llueva, el ejercicio antes de una comida es bueno para la salud.
Now it's easier to see why you would need the subjunctive there. Going back to the examples you've given, they can be thought of as subordinate phrases where the main sentence has been elided:
Vayas donde vayas, te encontraré.
Lo que quiera que haga, nada me sale bien.
Because both subordinate clauses are unspecific, they call for the subjunctive.
The phrase "donde quiera que vaya" is similar but a bit different in that it is a subordinada adverbial de lugar, that is, a subordinate that specifies a place. You can recognize a "subordinada de lugar" by swapping the subordinate with allí or en ese sitio:
Puedo verte donde quiera que vaya -> Puedo verte allí. / Puedo verte en esos sitios.
If such place is vague or unspecified, as is the case with "donde quiera que vaya", you need the subjunctive.
I hope I've made the grammar a bit clearer. It might be just easier to remember that you need the subjunctive because the prases "wherever" or "whatever" introduce a sense of vagueness that fits the subjunctive mode better than the indicative mode.