On a floured work surface, roll each sheet puff pastry to a 10-by-13-inch rectangle. Transfer to two parchment-lined baking sheets and refrigerate. In a small saucepan, melt butter over medium. Add flour; cook, stirring, until golden, 1 minute. Whisking constantly, add milk and simmer. Stir until thickened, 5 minutes. Season with salt, pepper, and pinch of nutmeg. Pour sauce into a bowl and let cool 30 minutes.
Preheat oven to 400 degrees, with rack in lower third. Arrange ham evenly on 1 pastry sheet, leaving a 3/4-inch border; top with cheese and sauce. Brush pastry border with egg; top with second pastry sheet. Fold bottom edges over top and press to seal. Brush top with egg and cut vents in tart. Bake until browned and puffed, 30 minutes. Serve warm or at room temperature.