Peel and finely dice the onion and garlic. Heat the oil in a pot and fry them both in it until transparent. Add spinach and milk and cook covered over a low heat for about 20 minutes. Stir frequently.
Cook spaghetti in boiling salted water according to package instructions. Fry bacon in a hot pan without fat until crispy. Bring spinach to the boil once. Season to taste with salt and nutmeg. Drain the pasta, let it drain and mix with the spinach sauce.
Put bacon on top and slice parmesan cheese over it.