Just a day after Locke was installed as Jambos boss on a permanent basis, his side took an early lead and had several chances to double their advantage.
But St Mirren equalised and claimed the lead a minute after the break, and Locke admitted his team's poor start to the second half had proved costly.
He said: "I'm disappointed. I thought when we were 1-0 ahead we had chances after that to go 2-0 up.
"I'm really disappointed with the start of the second half where we never really got going at all and that's cost us the game."
Conor Newton made it 3-1 on 66 minutes before Hearts launched a spirited fightback, but Ryan Stevenson's second goal of the final five minutes from time was their lone reward.
"I'm looking for total commitment from the players and to their credit they did produce that," Locke added. "In the last 20 minutes we put St Mirren under pressure and did put balls in their box.
"Stevo scored a good second goal and could have had a second one so we're really disappointed.
"It's been one of those seasons where we've been really disappointed with the way things have gone but we've got to keep our heads up," he added.
"We've got important league games still to come and between now and the end of the season we've got to win as many games as we can."