Harry asks Dumbledore why the Ministry couldn't detect Tom Riddle's magic:
"But how come the Ministry didn't realize that Voldemort had done all that to Morfin?" Harry asked angrily. "He was underage at the time, wasn't he? I thought they could detect underage magic!"
"You are quite right — they can detect magic, but not the perpetrator: You will remember that you were blamed by the Ministry for the Hover Charm that was, in fact, cast by —"
"Dobby," growled Harry; this injustice still rankled. "So if you're underage and you do magic inside an adult witch or wizard's house, the Ministry won't know?"
"They will certainly be unable to tell who performed the magic," said Dumbledore, smiling slightly at the look of great indignation on Harry's face. "They rely on witch and wizard parents to enforce their offspring's obedience while within their walls."
As for why the Ministry didn't investigate, well they actually did investigate, and the investigation led them to Morfin. As Dumbledore explained:
"The Ministry, on the other hand, knew at once that this was a wizard's murder. they also knew that a convicted Muggle-hater lived across the valley from the Riddle house, a Muggle-hater who had already been imprisoned once for attacking one of the murdered people.
"So the Ministry called upon Morfin. They did not need to question him, to use Veritaserum or Legilimency. He admitted to the murder on the spot, giving details only the murderer could know. He was proud, he said, to have killed the Muggles, had been awaiting his chance all these years. He handed over his wand which was proved at once to have been used to kill the Riddles. And he permitted himself to be led off to Azkaban without a fight.