Heat oil in a large skillet over medium heat. Add onion, celery, rosemary, red pepper flakes, salt, and pepper; cook and stir with a wooden spoon or spatula until onion starts to turn translucent, about 4 minutes. Stir in garlic and cook for 1 minute.
Push onion mixture to outer edges of the skillet and crack egg into the middle. Break yolk with the wooden spoon and stir in onion mixture. Add tomatoes; cook and stir until egg is almost cooked, about 3 minutes. Stir in feta cheese until slightly melted, about 1 minute. Add spinach. Remove from heat and stir until slightly wilted, about 30 seconds.