The city tops the league table by netting landlords annual pre-tax returns of almost 5% on their investment.
Edinburgh also performed above the UK average, with returns of nearly 4% for investors.
The figures were released by property website Zoopla.co.uk, which analysed average gross yields on four-bedroom student properties across the UK. Gross yield is defined as a yearly return on an investment before the deduction of taxes and expenses.
The researchers concluded that Glasgow, with an average monthly rent of £1,083 for a four-bedroom house, produced a gross yield of 4.95%, surpassing the likes of London, Oxford and Cambridge.
Edinburgh, which also includes the Fife university town of St Andrews, came second on the Scottish league table with yields for landlords of 3.96%. There, average monthly rents for four-bedroom properties come in at £1,474.
Stirling was the third best Scottish investment prospect for landlords, with gross yields of 3.6%.
Looking at Scotland as a whole, Zoopla found the average gross yield for landlords stands at 4.17%, beating the UK average of 3.8%.
The average rent for four-bedroom houses north of the border is £1,154.
Sitting behind Glasgow in the UK league table are Hull at 4.8% and Manchester, Cheltenham and Cambridge all at around 4.5%.
At the other end of the UK scale, those with the worst returns were Carlisle, at 2.58%, Middlesbrough at 2.61% and Bournemouth, which just edged over 3%.
Despite having the largest student population in the UK, London came in as only the 10th most attractive place in the UK to invest in student accommodation.
Lawrence Hall, of Zoopla.co.uk, said: “The largest number of students or most prestigious university clearly isn’t necessarily best for investment returns.
“Landlords need to do their research and take into account the student demand, property supply, average property values and average monthly rents.”