We know that polar substances are soluble in polar solvents and non polar substances are soluble in non-polar solvents only. Here the hydrocarbons are non-polar molecular substances and water is a polar solvent. So water can't dissolve hydrocabons.
Hence, as hydrocarbons are non-polar substances, they are insoluble in water as it is a highly polar solvent.