I have obtained 4"x4" Douglas Fir wood that are often used for fence post. You can use Pine wood too. Just avoid using Redwood or pressure treated wood posts as these have insect repellant properties. Mason Bees wouldn't be too happy in those types of wood. I use Douglas Fir, and they costs about $8 for a 6 ft long 4"x4" post. You can go to the wood scrap section of the store, and often you can get odd lengths and can be bought for less than $1 a piece. I got my 3 ft long 4"x4" for free from the scrap bin because the wood that I got has a few cracks in them, so the nice guy at the store just gave it away to me.
The 4"x4" actual dimension if you measured it is exactly 3.5" x 3.5". The major reason is that it is smooth all sides, and so some dimensions were lost during the smoothing process. Simply cut the wood into 6" long pieces. The actual dimensions of the wood blocks shown above is 3.5" x 3.5" x 6". You make a lot of these houses for future expansion of your bees.