Clean and wash the spinach, blanch it in boiling salted water and let it drain. Roast pine nuts in a pan without fat. Cut the ham into strips. Peel onions and garlic, dice finely. Fry everything in hot oil. Add tomatoes and cream, reduce a little. Wash basil, dab dry, put some leaves aside.
Cut the rest into fine strips. Add basil, spinach and pine nuts to the sauce. Cook briefly, season with salt and pepper. Put the cappelletti in boiling salted water and let them simmer at low heat for 3-4 minutes. Drain, serve with the sauce and garnish with remaining basil leaves. Sprinkle with cheese