1. Cook spaghetti according to package directions, reserving 1 1/2 cups pasta water; drain.
2. Meanwhile, heat oil in a large saucepan over medium-high heat. Add garlic and onion and cook until softened, about 5 minutes. Stir in tomato paste, roasted red peppers and sugar and cook until just thickened, about 2 minutes. Transfer red pepper mixture to a blender; process until smooth.
3. Return pan to stove, add thyme and red pepper flakes and cook over medium-low heat until fragrant, about 1 minute. Add spaghetti, red pepper puree and salt to pan, stirring to combine. Add reserved pasta water and cook over medium-low heat until sauce just clings to spaghetti, about 2 minutes. Sprinkle with walnuts and goat cheese.