"She is not eating the sugar."
Translation:Hun spiser ikke sukkeret.
"ikke" can always be replaced by "ei" (but not always the other way, as 'ei' can also mean 'a/an'), but it's uncommon to do so.
I don't know why you got "Hun spiser ei sukkeret" as the suggested correct answer, as it should'e been "Hun spiser ikke sukkeret", as this is the most common way of saying it.
As to why you're sentence was incorrect: In declarative sentences the verb should always be in the second position (Norwegian is a V2-language). Adverbs, such as 'ikke' should come after the verb.