Ross Jones, 19, was caught selling the potentially lethal drug to festival-goers and was found to have 28 of the tablets worth nearly £300.
Perth Sheriff Court heard that Jones had been booted out of the Scouts and fired from his job in a Glasgow department store.
The university dropout was seen circling the Slam Tent at the music festival selling the Class A drug to several people.
Jones, from Lilybank Avenue in Glasgow, admitted being concerned in the supply of Ecstasy on 13 July.
Fiscal depute Stuart Richardson told the court: "Police officers observed Mr Jones speaking to a festival-goer.
"There appeared to be an exchange taking place and something was given to the festival-goer, with Mr Jones seen to receive something in return.
"He was detained and searched and in his front trouser pocket they found 27 Ecstasy tablets. Along with the o ther one there were 28 in total."
Solicitor James Carmichael, defending, said his client had bought the tablets for £5 each and sold them on for £10.
Sheriff Lindsay Foulis sentenced Jones to four months' detention.