In a large pan, heat olive oil over medium heat. Add sausage and onion; crumble sausage and continue to cook until sausage is no longer pink. Add garlic and saute until garlic is fragrant, about 30 seconds. Add pasta sauce and tomato paste; stir to combine. Add spaghetti. Slice half of pepperoni in half and add to pasta mixture. Stir in half of the cheese. Pour pasta into a large baking dish. Top with the rest of the cheese and pepperoni.