This one surprised me; I thought they would all float with sides vertical and horizontal.
In fact, both the Balsa and Osage Orange will float that way (A), as will any very light (sg < ~.21) or very heavy (sg > ~.79) wood.
Middle-weight woods such as the fir, and any other with ~.28 < sg < ~.72 will float as in illustration B, with one diagonal vertical and the other horizontal.
Woods in the "transition weight zones" such as the maple in my example will float with neither sides nor diagonals horizontal.
The key to this is to look at the center of gravity of the block (which is the geometric center of the square) and the center of buoyancy keeping the block from sinking (which is the center of the "hole" in the water displaced by the underwater part of the block). These have to be aligned when the block is stable. Also, any deviation from that stability position must cause the gravity and buoyancy centers to misalign in a way that rotates the block return to the stability position.
This web site gives a much more thorough explanation.