Why are most hydrocarbons, like alkanes and alkenes, less dense than water?
There is no truly simple explanation for bulk properties of liquids. But the balance of two factors probably goes a long way to explaining the difference between water and simple hydrocarbons.
The density of a liquid is determined by the mass of the molecules and the efficiency of how they pack in the liquid.
Molecules made of heavier atoms will tend to be denser (e.g. chloroform where the heavy chlorines give the liquid a density about 50% higher than water). Water is made of moderately heavier atoms than a hydrocarbon (oxygen is about 30% heavier than carbon).
The other factor is how well the molecules pack in the liquid. This depends on their shape and the molecular interactions among them. Water molecules have very strong hydrogen-bond interactions causing them to, on average, stay closer than molecules of equivalent size that don't hydrogen bond. Hydrocarbons have only weak van der waals interactions so don't, on average, stay so close.
The interaction of the molecular mass and the forces determine the overall density. Water wins on both compared to hydrocarbons.
Density is not only related with mass, but with volume too. Density of a substance is its mass per volume. It means increasing volume will decrease the density.
The molecules of hydrocarbons are large in size, increasing the length of their chain will increase both their mass and volume. On the other hand, water molecules are smaller and simpler in structure, but it is heavier than its size.
Density depends on mass and volume. Higher mass and lower volume occupied per molecules promote density. Hydrocarbons have high molecular mass (except methane) and molecules take more space due to presence of vander wall force only. In case of water molecules due to presence of hydrogen bond molecules take less space ya they are more compact than hydrocarbons resulting instead of more molecular mass of hydrocarbon they are less denser.