Select Sauté on the Instant Pot® and heat 2 tablespoons of the butter. Add the shallot and cook, stirring occasionally, until just softened, about 1 minute. Add the ham and cook, stirring occasionally, for 2 minutes. Add the remaining butter and the spinach and cook until the spinach is wilted, about 5 minutes. Add the cream and 1/2 teaspoon salt and cook until most of the liquid has been reduced, about 15 minutes.
Add 1/4 teaspoon pepper and taste, adjusting seasoning as desired.