Steffan Evans and Michael Collins' second-half scores had cancelled out Matt Healy's first half effort, but two penalties apiece from Jack Carty and Craig Ronaldson looked to have handed the visitors a much-needed win.
But with Aled Thomas keeping Scarlets in touch off the tee, the scene was set for Shingler to slot the decisive 78th-minute penalty through the uprights after Ronan Loughney was sin-binned for a tip tackle in a ruck.
And while Lam is adamant the attitude and work ethic of his players is up to scratch, he admitted he was left counting the cost of ill-discipline on Sunday.
"We are gutted," he told RTE Sport. "It's another good performance from the boys. We created a lot of good opportunities again - we probably didn't take some of them.
"We gave a few penalties away which were needless and silly. Discipline at this time of the year is crucial as we found out against Ulster and Leinster.
"I'd be more concerned if the effort wasn't quite there. If we continue to concentrate on things we can get better at we will get there. There's a long way to go."
To buy tickets for the GUINNESS PRO12 Grand Final click here. Also follow us on Facebook, join the conversation on Twitter, sign up to our YouTube channel for extensive match highlights and sign up for our newsletter for regular updates on the GUINNESS PRO12.