Heat oil in a skillet over medium heat; stir in onion and garlic. Cook and stir until the onion has softened and turned translucent, about 5 minutes. Add corn kernels, oregano, cumin, salt, and pepper. Saute, stirring occasionally, for 10 minutes. Add spinach and parsley, cover, and cook for an additional 2 minutes.
Preheat the oven to 350 degrees F (175 degrees C).
Place drained pinto beans into a separate bowl and mash with a potato masher or fork until they are almost paste-like. Place 1/2 of the shredded cheese in a bowl for easy enchilada assembly. Pour 1/2 of the enchilada sauce into a 9x13-inch baking dish.
Assemble enchiladas: take 1 flour tortilla, smear some mashed beans vertically along the right side of the tortilla. Place 2 to 3 tablespoons corn mixture on top of the beans, and then some shredded cheese on top of the corn mixture. Starting at the right edge, roll tortilla to the left and place seam-side down in the prepared baking dish. Repeat with remaining tortillas and fillings.
Pour remaining enchilada sauce evenly on top of rolled tortillas. Sprinkle with remaining cheese and any remaining corn mixture.
Bake in the preheated oven until sauce is bubbly and cheese is melted, about 20 minutes.