Simply killing the male will not solve your problem. To treat the carpenter bee holes use Drione Dust and a Crusader Duster. As the female enters the hole she will drag the dust into the nest and kill all the larvae. Drione lasts for many months and is very safe. After 2 or 3 days plug the holes.
Natural cork does a good job as a hole plugger.
This makes it easy to see new activity and keeps the dust inside to kill the larvae. If you must kill the harmless male carpenter bee then use a Wasp and Hornet Aerosol. To prevent future drilling of new holes in the wood spraying the wood with a good residual insecticide like Ficam W is recommended. Ficam W is also an excellent product for the control of ants, spiders, big roaches and scorpions, both inside and outside the home.