Place the baking rack in the top third of the oven and preheat the oven to 350° F/175° C.
Melt the butter in a 3-quart pot. Sauté the onion in the melted butter until softened, about 3 to 4 minutes. Add the drained diced tomatoes and chilies and cook, stirring, until the tomatoes are warm, about 3 minutes.
Add the corn kernels and milk and cook over medium heat until the mixture is thoroughly warmed, about 5 minutes. Add the cream cheese chunks and cook until melted, about 5 more minutes. Add the sea salt and pepper and stir the mixture well.
Pour into a 9-inch baking dish coated with cooking spray and spread evenly. Sprinkle the grated cheddar over the top. Bake in the preheated oven until the cheese melts and is lightly browned, about 15 minutes. Remove and allow to cool for 2 to 3 minutes, then serve.