TL;DR: he didn't say it
This answer is based entirely off a Quote Investigator article. They found several instances of the same idea being expressed, just none by Bernard Shaw.
QI starts off with:
QI has found no substantive evidence that George Bernard Shaw wrote or spoke this statement.
The earliest citation that QI found for this quote is a 1925 book. QI quotes from Social Classes in Post-War Europe (1925) by Lothrop Stoddard:
Gorky relates how, after addressing a peasant audience on the subject of science and the marvels of technical inventions, he was criticized by a peasant spokesman in the following manner: “Yes, yes, we are taught to fly in the air like birds, and to swim in the water like the fishes; but how to live on the earth we don’t know.”
They acknowledge that this is indirect evidence as it is someone else saying that Gorky heard someone else say the quote. However, several other sources quote this one; it is the general source given for this idea. Here are two instances of others referring to Gorky or his peasant as the source.
C. E. M Joad, a book reviewer from “The Spectator”, about a book Kalki or The Future of Civilization (1929) by Sarvepalli Radhakrishnan, as quoted on QI
Professor Radhakrishnan quotes with approval the comment of a peasant upon the marvels of science introduced to him in a lecture by Maxim Gorky. “Yes, we are taught to fly in the air like birds, and to swim in the water like fishes, but how to live on the earth we do not know.”
A 1935 PTA meeting speaker, as quoted on QI
A Russian peasant has said, “Yes, we have learned to fly through the air like birds and swim under the water like fish; but to live on the earth like men, this we have not learned.”
In conclusion, QI would tentatively attribute the saying to a Russian peasant; however, there is considerable uncertainty.
More examples and a deeper tracing of this quote/idea through history are present in the QI article.