Preheat the oven to 400˚F. Spray a 9-inch round springform pan with cooking spray. Bring a large pot of salted water to a boil. Add the pasta and cook until not quite al dente and still chewy, 5 to 6 minutes. Drain.
Whisk together the cream cheese and eggs in a large bowl until smooth. Gradually pour in the half-and-half, whisking until combined. Stir in 2½ cups of the mozzarella, 1 cup of the parmesan, and the salt and pepper.
Add the spaghetti to the bowl, tossing to coat. Transfer to the prepared springform pan and top with the remaining ¼ cup mozzarella and 2 tablespoons parmesan.
Dot the spaghetti with the butter and sprinkle generously with pepper. Bake until golden brown around the edges and bubbling, about 30 minutes. Let cool in the pan for 15 minutes, then remove the springform ring and transfer the pie to a board or platter. Sprinkle with more parmesan, slice into wedges, and serve with salad.
