Since I argued to re-open this question I should put the effort in to answer it :)
As other answers have pointed out, there are important cultural reasons why we use cubical bricks, and different architectural traditions may predominantly use bricks of different shapes. Not all bricks are cuboid - if you look at a brick building that contains arches (such as an old bridge or railway station) you will find that it contains bricks that are not quite cuboid in shape. However, I would say that cuboid bricks are the optimal shape for the purpose they're designed for, which is to build relatively thin straight-sided vertical walls that are usually at right-angles to one another.
The first consideration is that the wall needs to be straight. Having the top and bottom surfaces of the brick parallel to one another is a good way to do this. You could do it in other ways. For example, by using bricks that are trapezoidal in cross-section. The picture below illustrates this, along with the problem it would bring:
Although the wall would be straight-sided, each brick is sitting on an inclined plane, and thus wants to slide out sideways. Although the mortar would prevent this, such a wall would be less stable, and also less practical to build.
Of course, if you want to build an arch or an igloo then this is exactly the sort of brick you need, and if you look at an arch you will see this type of brick:
but this takes us away from our design goal of a vertical wall.
So if you want to build a straight-sided vertical wall then the bricks need to be rectangular in cross-section. This only leaves the "end" surfaces, which in theory could be at any angle as long as they tesselate. However, making them be at right-angles to the other two sides makes it easy to build two walls that join at right-angles without needing to break any bricks, like this:
This also contrains the length of the sides a bit - the bricks must be twice as wide as they are deep in order for that to work. The only free parameter is the height of the brick, which can vary depending on the type of brick. (Think of the shape of a breeze block compared to a red brick.)
So although there are other types of brick suitable for other purposes, the cuboid form is very good for building rectangular-sided buildings with straight walls, and I would say that the design has survived throughout history because of this.