Empty your bottle after every ride and store it upside down so it drains. If you leave a half-full bottle on your bike, it will get gross a lot faster.
Wash the lids/caps, which have crevices and screw threads where crud can lurk. Also, they pick up chapstick from your lips, crumbs from what you just ate, etc.
If you carry anything other than water in your bottle, wash it and the cap after every ride.
Some people keep their Camelbacks in the refrigerator--the cold retards the growth of mold.