Why is my cube looking like this with the glass material?
No need to overcomplicate things.

Here is how you do it:

Solution 01 (physically accurate)
Use Principled BSDF shader


Leave everything as is (very important)  
Set Transmission to 1  
Set Roughness as desired
Boom, you have realistic glass.


Solution 02 (old, not physically accurate)
Use Glass BSDF


Set roughness as desired


Example of both, side by side:


Tip:
If you're going for realism, use Principled BSDF wherever you can. It solves many issues for you such as fresnel, light fall-off, etc…  

BlenderGuru explains all of it’s nodes.