I'm not sure if if would be considered grammatically incorrect or not, because the "to do" is included.
All I wanted to do was to go out with my friends.
All I wanted to do was go out with my friends.
All I wanted was to go out with my friends.
All I wanted was go out with my friends.
Because there is an infinitive here (in the second example), it sounds correct to me, although I am not 100% positive. In the fourth example, which no native speaker would ever say, there is no infinitive, so that one is certainly incorrect.
I've looked around at some grammar sites, and while I haven't found anything definitive, what I have found seems to indicate that the extra "to" may even be incorrect, or at least unnecessary.
Some examples I found:
All we have to do nowadays is study hard. (NOT All we have to do nowadays is to study hard)
All you need to do is look through some grammar books. (NOT All you need to do is to look through some grammar books)
All you have to do is think about it. (NOT All you have to do is to think about it)
All you have to do is read the book and have fun. (NOT All you have to do is to read the book and to have fun.)
And here is a grammatical discussion of this topic, where it is said that the extra "to" is redundant.
The sentence, "All I wanted to do was go out with my friends" is completely grammatically correct.
The 2 options that Camparta offered as possible "more correct" alternatives to the above original sentence:
1. All I wanted was to go out with my friends.
--> This one is also perfectly correct. The only difference between the original and this one is that "to do" was included in the original and omitted in this one. Including "to do" does not make the original version "incorrect", it's just a different way of saying the same thing, they're both fine, there's nothing "more" or "less" correct about either version. For people who say it's wrong to include "to do" in the original, maybe it sounds too clunky?
2. All I wanted was going out with my friends.
--> To my ear, I think that one is probably technically grammatically correct, but it sounds questionable, it doesn't sound right to my ear. It's probably something people might say, but I wouldn't and I don't think I hear it much.
I said what I said based on what I learned at the UCDAVIS Extension Program. I remember my Advanced Grammar teacher said that it would be normal to hear people say that, but it was not the best grammar rule to follow.
It seems to be that it's more a like-dislike language thing.