Cook the spaghetti according to the package directions; drain and return it to the pot.
Meanwhile, heat the oil in a large pot over medium-high heat. Add the bacon and cook, tossing often, until crisp, 6 to 8 minutes.
Add the onion, thyme, ¼ teaspoon salt, and ½ teaspoon pepper. Cook, stirring often, until soft, 8 to 10 minutes.
Add the tomatoes (and their juices) and escarole. Cook, tossing often, until the escarole is tender, 2 to 4 minutes.
Serve the pasta topped with the sauce and Parmesan.