For a semi-permeable membrane, the molecule that it is permeable to goes through the membrane in both directions. For the sake of the argument, assume a semi-permeable membrane that is permeable to water, but not permeable to sugar.
When distilled water is placed on one side of this membrane, and a concentrated sugar solution is placed on the other side of the membrane, the membrane sees an interesting effect at the molecular level. On the distilled water side of the membrane, a lot of water molecules are going across the membrane, with the rate of mass transfer being dependent on the temperature (water molecule velocity is a function of temperature) and the characteristics of the membrane. On the sugar side of the membrane, a lot of sugar molecules are trying to go through the membrane, but they can't. These molecules are hindering water molecules on that side of the membrane because they are getting in the way of the water molecules, so a lower rate of water molecules can diffuse from the sugar side of the membrane to the distilled water side of the membrane. This imbalance means that there is a net flow of water from the distilled water side (higher concentration of water) to the sugar side (lower concentration of water).
As noted, this effect continues, and the level of solution on the sugar side of the membrane continues rising, until the pressure on the sugar side of the membrane is equal to the osmotic pressure of the system. At that point, there are equal rates of water mass transfer across the membrane, and the water level stops rising on the sugar side of the membrane.
The energy for this process is due to the kinetic energy of the water molecules in the system, but it is also due to the fact that sugar disturbs the rate of mass transfer of water on that side of the membrane. Note that the temperature of the fluid on both sides of the membrane can be expected to remain constant as the above process takes place.