Make crepes, stacking as they are done; reserve, covered with clean cloth.
Cook spinach according to package directions and drain thoroughly. (If using fresh spinach, cook over high heat in tight-lidded pot, using only the water that clings to the leaves, just until wilted, 3-5 minutes; drain thoroughly and chop roughly with a heavy knife.) Squeeze spinach between your hands to remove as much moisture as possible.
Heat oil over medium-high heat in medium skillet. Add garlic and most of chopped onion (reserve about ¼ cup to use later). Saute 2-3 minutes, stirring often. Add spinach, toss to combine well, and saute 5 minutes, stirring occasionally. Set aside.
Drain and reserve juice from 1 eight-ounce can pickled jalapeños. Finely chop 3 pickled jalapeños (or more to taste). Combine ground ham, chopped jalapeños, and reserved juice. Set aside.
Combine sour cream with deviled ham, chopped cilantro, and the rest of the chopped onion. If desired, add a little salt (but not if ham is strongly salty). If sour cream is very thick, thin the mixture with 1-2 tablespoons milk. Set aside.
Preheat oven to 325°F.
To assemble the casserole, butter a 9- x l3-inch Pyrex baking dish (or other baking dish with sides about 2 inches high). Line bottom with 8 crepes. Spread with ⅓ of the sour cream mixture. Cover this with ½ of the ham mixture. Sprinkle ham with half the spinach. Cover spinach with ⅓ of the shredded cheese.
Cover cheese with 8 more crepes and repeat the layering: ⅓ of sour cream mixture, ½ of ham mixture, ½ of spinach, ⅓ of the shredded cheese. For the final layer, add remaining 8 crepes and top with remaining sour cream and cheese.
Bake until heated through and cheese is bubbling.