I have seen bees do this before, but usually late in the evening or early in the morning. I had figured they were going into (or coming out of) some sort of torpor for the night. In the middle of the day, though, it seems like they should have been at the peak of their activity. So I am not sure if these bees were just resting or if they were doing something else.
Most Carpenter Bees burrow into wood, sometimes including residential structures, for nesting. They are generally solitary, but sometimes cluster their nest burrows together. Each nest has a single circular entrance hole that branches into multiple chambers where the larvae develop.
Each image links to a photo on Flickr.