Tension acts in the opposite direction of the gravitational force. If the object is hanging it must be balanced by tension, otherwise, it will accelerate down due to gravity.