If I have a fever in the second trimester, does that put the baby at risk?

Depends on situation. Illnesses that you have that are localized like a cold or ear infection have no effect on baby. If you have an illness with a blood phase, where the germ gets into the blood, like the flu or measles, the baby can be affected. Best check it out with your doctor to be sure.
Why the fever? Depends what the fever is from. Most common infections that cause fevers do not hurt your baby. There are some, though, that can - rubella, for example.