Step 1
Place three 28-oz. cans whole peeled tomatoes with their juices in a large bowl, crushing with your hands as you go; set aside.
Step 2
Cook 8 oz. smoked bacon (about 8 slices), finely chopped, in a medium Dutch oven or other heavy pot over medium heat, stirring occasionally, until some fat has cooked out and bacon is browned but still soft, 6–8 minutes. Using a slotted spoon, transfer bacon to a small bowl. Drain off all but 3 Tbsp. fat from pan; save for another use or discard.
Step 3
Set pot over high and heat fat until very hot. Arrange 2 medium onions, peeled, halved through root ends, and 2 medium shallots, peeled, halved through root ends, cut side down, in pan; cook until charred underneath, 2–3 minutes. Return bacon to pan and add 10–12 garlic cloves, coarsely chopped, one 7-oz. can chipotle chiles in adobo, chiles finely chopped, adobo sauce from can, 1 Tbsp. smoked paprika, 2 oz. basil (about half of a small bunch), and reserved tomatoes. Reduce heat to medium and cover, leaving lid slightly askew. Cook, stirring occasionally to keep sauce from sticking and adjusting heat as needed to maintain a gentle simmer, until thickened, 2–2½ hours. Using a slotted spoon or tongs, remove any big pieces of onion and stringy basil stems; discard. Stir 1 tsp. Diamond Crystal or ½ tsp. Morton kosher salt into sauce; season with freshly ground pepper.
Step 4
When sauce is about 20 minutes away from being done, cook 1½ lb. spaghetti in a large pot of boiling salted water, stirring occasionally, until al dente. Drain, reserving 2 cups pasta cooking liquid.
Step 5
Add 5 Tbsp. unsalted butter, pasta, and 1 cup pasta cooking liquid to sauce and cook over medium heat, stirring often and adding more pasta cooking liquid as needed, until butter is melted and incorporated and noodles are coated in sauce and glossy.
Step 6
Divide pasta among plates or shallow bowls and top with basil leaves.