We have investigated the electronic and optical properties of a water adsorbed carbon nanotube (CNT) with boron/nitrogen co-doping by means of density-functional theories (DFTs). These properties play an important role in biological application of the co-doped nanotube. The positions of the inside adsorbed water molecules are all much alike due to confinement effects. The calculated results indicate that the water can be stably adsorbed both inside and outside of the co-doped nanotube. More importantly, the water molecule can act as donor or acceptor depending on its position. The adsorption can significantly decrease the band gap and enhance the localization of the π electron. The optical properties are affected nonlinearly owing to the strong interactivity between the water molecule and the nanotube.