Which makes me wonder: why isn't it practicable to generate
electricity by drawing thermal energy from the environment?
You can do it but it may not be practicable because you will always need to find an even lower temperature environment to reject some heat to and the efficiency would probably be very low. There will always be the need to reject some heat to a lower temperature environment in order to produce net work in a cycle. The Kelvin Planck statement of the second law, essentially says:
It is impossible for any device that operates on a cycle to receive heat from a single reservoir and produce a net amount of work.
The left most diagram below shows a violation of the Kelvin Planck statement. Although it is possible for a single process within a cycle to extract heat and produce work, such as the reversible isothermal expansion of a Carnot heat engine cycle, it is not possible as the sole result of a thermodynamic cycle. You will always need a lower temperature environment to reject some heat.
Regarding efficiency, let's say you take heat from outdoors on a hot summer day of 100 F (311 K) to operate your heat engine and reject heat indoors at say 70 F (294 K). The maximum (Carnot) efficiency of your engine will be $1-\frac{T_L}{T_H}$ or about 5%.
Do the laws of physics prevent the heat that heat pumps deliver from
being used for electricity generation by whatever means (e.g. steam
turbine)?
No, but I agree with @Andrew Steane answer that the best you can do is break even by using the work output of a perfect heat engine to provide the needed work input to operate a perfect heat pump.
The right two diagrams shows what Andrew describes as a perfect heat pump (a Carnot heat pump) driving a perfect heat engine (a Carnot heat engine). The heat delivered to the high temperature reservoir by the heat pump is taken by the heat engine to produce work output rejecting some heat to the low temperature reservoir. The heat pump then takes that rejected heat from the low temperature reservoir and uses the work output of the heat engine as its work input required to deliver heat to the high temperature reservoir.
As Andrew stated the best that can be done (for a Carnot heat engine and Carnot heat pump) is for the electrical work produced by the heat engine to equal the electrical work required to operate the heat pump, for a net work of zero. And this can only occur if there is no overall (systems plus surroundings) increase in entropy, which is the case here for the following reasons.
Since both the heat pump and engine are operating in a cycle, the initial and final entropy (initial and final states of the systems) have to be the same, for total entropy changes of each system equal to zero.
The total entropy change of the high temperature reservoir is zero since the heat delivered to it by the heat pump equals the heat taken from it by the heat engine, each divided by the same temperature.
Likewise the total entropy change of the low temperature reservoir is zero since the heat extracted from it by the heat pump equals the heat rejected to it by the heat engine, each divided by the same temperature.
The net result is that the total entropy change of the systems plus surroundings is zero, which can only occur for reversible processes. For all real processes there will be an increase in total entropy. That, in turn, would mean less efficiency for both the heat pump and heat engine, i.e., less work output for the heat engine for the same heat input from the high temperature environment, and more work input needed for the heat pump to transfer the same amount of heat to the high temperature environment.
Hope this helps.