During the disolution of a compound C in a solvent S, intermolecular forces between molecules of C and between molecules of S are broken (which requires energy), and intermolecular forces between each molecule of C and several molecules of S around it are formed (which releases energy). As such, dissolution of C into S is only favorable if the released energy is greater than the required energy.
Let's consider octanol $\ce{CH3(CH2)7OH}$ in water. We need to break the hydrogen bonds between octanol molecules and the London dispersion forces in them to separate the molecules, and we need to break the hydrogen bond network in water to accommodate each octanol molecule. Then, we surround each octanol molecule by water molecules. Only the polar head ($\ce{OH}$) will be able to form new hydrogen bonds (and account for the broken ones), but the interaction between water and the hydrophobic tail is merely permanent dipole-induced dipole, which are weak compared to all the hydrogen bonds we had to break between the water molecules to be able to accomodate the large hydrophobic portion, so we're losing energy rather than gaining it. Thus, this will be poorly soluble in water.