Is saying "I had a fever" correct?
Working on the principle that "correct language" is defined as the common usage among native speakers of the language: "I had a fever" is correct. I don't think I've ever seen "I had fever" in print and very rarely spoken.
In general, I think the rule is that when you are referring to something that is countable, you use an article. When you are referring to something that is not countable, you do not. Thus you would say, "I had a dog" or "I had the chair", because we can count dogs and chairs, i.e. there might be one dog, two dogs, etc. But you say, "I had food" or "I had happiness" because you cannot count "food" or "happiness", i.e. you would not normally say "two foods" or "two happinesses". Think of "a" and "the" as taking the place of the number "one".
Fever is countable. You could say "I had two fevers this year: one in January and another in March."
Which brings to my mind an interesting point: Some diseases are not considered countable. You wouldn't say, "I had two leprosies" or "I had two diabeteses". So we don't use "a" with those. I'm not quite sure what the rule is. Maybe: Long term chronic diseases are not countable, but short term diseases are? Like, "I had a fever", "I had a headache", "I had a cold", but "I had leprosy", "I had cancer", "I had manic-depressive disorder". Hmm, this is starting to sound like, "I have hypochondria".
Yes, "I had a fever" is correct, and "I had fever" is incorrect, at least in US English.
EDIT: I was unaware of the usage of the latter construction. I must now change my answer to "I've never heard it," and "It's much less common (at least during my lifetime it has ben)."
Google books "had fever" vs. "had a fever"
"I had fever" is not good English in any dialect I have ever heard. There's probably one somewhere.
@FumbleFingers found a lot of examples he linked in the comments below, most of which appear to me to be from medical texts or quotes from medical professionals. So this may be a somewhat common phrasing in the medical community.
The only other time I can think of where I've heard the "a" left off the front is in the old Peggy Lee song "You Give Me Fever". Perhaps your teacher heard it (it's a pretty hot song) and thought that was normal.