Why doesn't my boolean difference modifier work?
Booleans are very powerful tools but they are very picky about overlapping vertices and edges.
In this case you have a sphere with a top and bottom vertices which have a lot of connecting edges. Top vertex can be seen in attached image. Your boolean will break if the side of your object overlaps with any of these edges.

You could change you sphere to a round cube which doesn't have similar vertices on top and bottom. (To add a round cube use an build-in add-on Add Mesh: Extra objects). Round cube is easier to align with your object. Just make sure none of the vertices and edges overlap.