So this is a really fascinating topic that has bamboozled many meforshim and thinkers over the years.
The Talmudology website here helps to comprehensively break it down.
He first notes Rashi who says:
שפופרת - קנה חלול וכשהוא ארוך אין צופין בו למרחוק וכשהוא קצר צופין בו יותר והיתה שפופרת של רבן גמליאל מתוקנת למדת צפיית אלפים או בים או ביבשה
A tube: It was a hollow tube that when it is long you cannot see far though it and when it is short you can see farther. The tube of Rabban Gamliel was calibrated to measure 2,000 amot whether on land or sea.
When assessing this observation, the author asserts:
That sounds rather like a simple telescope in which the focal length may be changed. However, telescopes which use lenses to focus were invented (at least in Europe) only around 1608. We do not know the name of the inventor, though in October of that year a Dutchman by the name of Hans Lipperhey had submitted a patent for a telescope. Did Rabban Gamliel really use a telescope over 1,500 years prior to this patent?
He writes that modern day translations have analysed it as follows:
The Koren English Talmud suggests in a note that the tube was “a kind of precise protractor, similar to those used for astronomical measurements, i.e a type of sextant, the early form of which is known as an astrolabe.” The ArtScroll Schottenstein Talmud notes that Rabban Gamliel’s tube “operated without lenses, which were not invented until some fourteen centuries later.” It is challenging to figure out what exactly this tube was.
He notes how the mathematician and President of the Hebrew University of Jerusalem Selig Brodetsky (1888-1954) wrote a lengthy essay titled Astronomy in the Babylonian Talmud and notes that he finds it very difficult for Rashi to assert that it is a telescope given the period of the gemara and its relation to the technological advancement of the telescope.
As such, he moves on to the Rambam who views the instrument as being the astrolabe (like the Koren wanted to suggest).
שמסתכלין בו החוזים בכוכבים ונקרא בערבי אצטרל"ב ואיני רוצה להאריך ולהזכיר איך יושג כי זה הדבר בזה הענין ארוך ואפילו באריכות לא יבין זה אלא מי שידע בחכמת התשבורת
…It was the device used by astronomers and known in Arabic as an “astrolabe.” I do not want to go into lengthy details and describe how it is used, because it is a lengthy process. And even then only those who are especially knowledgeable will understand.
Another option is the possibility that it was the Nimrud Lens - discovered in 1850, it was a piece of crystal about 3,000 years old that appears to have been used to focus the rays of the sun, and perhaps even as a magnifying glass. There is however an academic dispute over its use, but at the very least it raises the possibility that people were using lenses long before the time of Galileo.
The author goes on to list various influential figures and their studies that hint to the possibility that the Rabbonim of the Gemara did in fact have access to some crude form of telescope or alternatively, "telescopes" served varying purposes throughout the ages.
Either way, his conclusions are as follows:
To sum, telescopes have served a number of different purposes for both rabbis and lay Jews.
For Rabban Gamliel it was used as a measuring device, (though it likely wasn't a telescope at all).
For Benjamin of Tudela is was a wondrous device to see for a distance of twenty days’ journey (though it was not a telescopes as we know them today, but some kind of mirror).
For Azariah Figo it was a device that taught a religious lesson: just as physical weaknesses may be overcome with human ingenuity, so too might spiritual weaknesses be overcome.
For Leon of Modena it was a proof of the greatness of Rabban Gamliel, who had used the device centuries before it was used in Europe.
For Avraham Yagel, it was was a similar message: the rabbis of the Talmud had previously invented the telescope, long before it began to be used in Europe.
For Joseph Delmedigo it was a scientific device that demonstrated the truth of the Copernican model.
For the Chofetz Chaim its invention reminded us of God’s providence in the world. Just as we can use the telescope to see high into the heavens, so too can God look down on us.
And for Vera Rubin, it was used as an object of honor for an extraordinary career.