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.
Press the Cancel button to reset the program. Make four wells in the spinach and carefully crack one egg into each well. Lock the lid in place and turn the valve to Sealing. Press the Pressure Cook button and set the cook time for 1 minute at low pressure.
Turn the valve to Venting to quick-release the steam. When the steam stops, carefully remove the lid. Transfer each egg on a bed of spinach to a plate, top with parsley, if using, and more pepper, and serve with a slice of crusty bread.