Weightlessness, or zero-g, is demonstrated by a falling body. No resistance is offered to the body as its mass attempts to follow the gravitational pull of Earth. The greater the mass of the body, the greater must be the resistance to prevent the body from falling. If resistance, or support, is measured by placing the body on a scale, its "weight" is measured. If no resistance or support is offered, and the body falls freely, it no longer has any weight. Bodies in orbit, such as the Moon, the Earth or a space ship, fall freely. The Moon falls in the Earth's gravitational field, and the Earth in the Sun's.
What causes a body on Earth or the Moon to have weight is the comparatively large mass of these bodies. A space ship does not have such a mass and therefore does not affect the bodies within its confines which fall freely together with the space ship, hence are weightless.