It's not a bug and it's not a Blender thing. Boolean algorithms are like that in most 3d software packages. Stored numbers are not infinitely precise in computers. Look into binary rounding errors if you want to know more. It just so happens that we can observe the consequences of these errors very clearly with boolean operations. Every time you have geometry that has vertices very close to each other or faces or edges that overlap and a boolean operation you may get unexpected results. This happens in all 3d software to some extent with polygonal modelling.
Try to avoid having surfaces that overlap in boolean operations. Sometimes you can make the parts bigger and still get the same boolean result but without errors. You may also move the objects very slightly to improve the results.
This is one of the main reasons you will see many experienced modellers avoid booleans altogether and/or dislike them in general.