Heat olive oil over medium heat in a large skillet. Stir in ham and cook until the edges are slightly browned, about 3 minutes.
Stir in garlic; cook until fragrant and edges are barely golden, about 1 minute.
Pour chicken broth over ham and garlic; bring to a simmer. Stir in butternut squash, red pepper flakes, and salt. Cook until squash is tender, about 15 minutes. Stir in black pepper and reduce heat to low.
Gently stir mascarpone cheese into squash mixture until completely incorporated. Stir in Italian parsley. Remove from heat and cover.
Bring a large pot of lightly salted water to a boil. Cook spaghetti in the boiling water, stirring occasionally until cooked through but firm to the bite, about 12 minutes. Drain and return to pot.
Pour butternut-mascarpone sauce over spaghetti, stirring until combined. Sprinkle Parmigiano-Reggiano cheese over spaghetti and serve.