Theirs a number of things that come to mind.
Someone has said virus, I have yet to see a virus that ejects a USB stick, normally they want to write to it and infect every machine that you stuff the drive in to. So I find it hard to believe. It could be a faulty stick, I have had one myself where the pins on the device did not make proper contact with the socket and it kept on "Ejecting."
I suggest that you try another slot, if that cures it, then the issue is with the slot that you were using, if it dos no then it is likely the device is faulty.
The other issue could be dirty contacts on the USB interface.
Another issue could be a power supply to the USB sockets on the computer.
I find it hard to believe that a virus will eject a USB stick, it is more likely to write to it and replicate on any machine that you put the device in to rather than ejecting the drive.
Another thought occurred to me and one in which windows (assuming that you use it) is the cause of the issue. My WinXP install, a genuine one was playing up and stopped recognizing my DVD burner and all USB devices plugged in to it. So I replaced the USB drive and the DVD burner only to find XP was acting very strange and after installing SP3 on the machine, if fell over and refused to get back up.
Eventually XP ceased to function, refusing to boot.
This I might add was a machine that has never been on the Internet and the SP3 was off a genuine M$ CD rom.
SO... Linux Ubuntu was installed as a secondary operating system. All USB devices and the DVD Burner all work fine under Ubuntu.
What does this mean? Simply watch out as your machine may be showing early signs that M$ has knobbled your machine like mine through installing a service pack.
If is funny how XP on my machine stopped recognizing USB devices at first then the DVD burner but under Ubuntu all devices I thought were broken work perfectly fine.
I advise you to go to Ubuntu web site, grab an Ubuntu ISO image file, burn it to CD-R and boot up as a live CD and test your USB by plugging it in.
If your USB drive functions fine under Ubuntu, then the issue is with Windows.