Take another look at the original sentence:
You wanted to fix it this way:
To add a comma between lecture and the would create an equally bad problem, a comma splice. A comma splice occurs when you have two main clauses joined with a comma alone. Michael tried to pay attention to the grammar lecture is the first main clause. The only problem was is the second main clause. The spot between lecture and the needs a stronger break than a wimpy comma.
You might want to consult the rules for fixing comma splices and fused sentences.