Graham Carey latched onto a short back pass from Callum Tapping to open the scoring for the visitors before Callum Paterson levelled things up for Hearts.
Melvin De Leeuw reinstated County's advantage but were put on the back foot after their captain Richard Brittain was dismissed for a second bookable offence.
Ryan Stevenson snatched a late equaliser for Hearts but Locke admitted he was disappointed with the manner in which his side conceded their goals.
"Without a doubt we shot ourselves in the foot," he said. "That was one part of our play I was disappointed with.
"They did not have to work hard for their goals. The two goals we lost were poor.
"The character was magnificent again though. They are giving us everything they've got and they are shattered in that dressing room.
"I am really disappointed for them because I felt, with our second-half performance, we fully merited three points.
"We had them on the back foot for long spells and they showed a lot of bravery and character getting on the ball."
County looked on their way to claiming all three points but for Stevenson's late heroics. Their manager Derek Adams thought they should have had the game wrapped up by half-time, but said he was happy with his side's attacking endeavour.
"I thought we were the better side in the first half and we should have probably been out of sight by half-time," he said.
"It was the best offensive performance we've had this season and I thought it was a terrific advert for Scottish football.
"It was end-to-end. It was like a basketball match at times and I think everyone would have gone home happy."