Preheat an oven to 375°F. Cut the bread into 1-inch chunks and spread on a baking sheet. Put in the oven for about 10 minutes—you're just drying it out a bit, you don't want to toast it. Let the bread cool.
Rinse the spinach to remove any dirt or grit: put it in a large bowl, cover with cool water, swish around, and lift the leaves out of the water and transfer to a colander or salad spinner to drain. Set the spinach aside.
Peel and finely chop the garlic or shallot. In a small frying pan over medium heat, melt 2 tablespoons of the butter. Once the butter is melted, add the garlic or shallot and cook, stirring, until softened and fragrant, about 3 minutes. Add the cleaned spinach and 1/4 teaspoon of the salt. Cook, stirring, until the spinach is wilted, has released its liquid, and that liquid has evaporated, about 10 minutes. Set aside and let cool.
Crack the eggs into a large bowl. Lightly whisk until the eggs are thoroughly broken up. Add the milk and whisk to combine thoroughly. Stir in the remaining 1/4 teaspoon salt and the pepper. Set aside.
Grate or crumble the cheese and set aside.
Use the remaining 1 tablespoon butter to coat a large (9 x 13) baking dish. Add the bread cubes to the dish. Arrange the cooked spinach mixture in and on and around the bread cubes. Sprinkle the cheese all over the bread and spinach, tucking it in here and thee. Pour in the egg-milk mixture; it should cover everything. If any bread cubes poke out, push them down into the liquid. Let the entire thing sit for at least 30 minutes (make ahead tip: cover and chill up to overnight; let it sit out for about 30 minutes before baking to take off the chill). Letting it all sit allows the bread time to soak up the egg-milk mixture, which will lead to a much better final texture than if you bake it right away.
Bake until basically set everywhere but just a bit jiggly in the center and browned along the edge, about 35 minutes. If it's getting too browned on top, cover with foil to cook a bit more.
Let sit at least 10 minutes and up to 30 minutes before cutting into pieces to serve. Serve hot or warm.