"Ideally, we would all like young people and the wider public not to use drugs illicitly, however, the reality is that they do in large numbers and the moral message to abstain from taking drugs is not getting through."
They now join the Australian Medical Association and the Royal Australian College of General Practitioners, who are also urging governments to adopt pill testing.
Five people have died after taking drugs at music festivals in NSW alone since September.
Ms Berejiklian has consistently rejected calls to introduce pill testing, despite emotional pleas from the families of some of those who have died.
She believes there is not enough evidence to show it can save lives.
But the RACP says evidence to date shows that existing policies at festivals to discourage drug-taking, including heavy police presence, sniffer dogs and searches, are not effective.
"These policies are failing our communities and our young people, leading to unnecessary deaths," Dr Lloyd-Jones said.
He wants pill testing to be trialled in purpose-designed facilities by qualified technical specialists and be accompanied by appropriate advice and information.
It should be developed in consultation with physicians, pharmacologists, toxicologists and other experts, he said.
"Pill testing is by no means a panacea; it needs to be implemented in conjunction with other evidence-based harm minimisation measures that prioritise the health and safety of festival goers over criminal and legal measures."
The NSW coroner is looking into the recent five music festival deaths, with a directions hearing to be held next Tuesday ahead of a likely inquest.