modifier in python works, but not the same as in the gui
Testing your code, it look to works fine with python 2.73, but i was able to reproduce your result with 2.78. 

So, first of all, blender boolean are very bad, sometime they fail for no "good" reason caused by overlapping geometry, edges, holes,... In your case the sphere has a ring exactly aligned with the cube face. 

A general solution would be so move slightly the sphere, let say positionning it in 2.001 would be enough. 

Another solution for Blender 2.78, the boolean now have two solvers, bmesh and Carve. Using carve seems to work better

bpy.context.object.modifiers["Boolean"].solver = 'CARVE'