I suspect its more that if a pax books the EK code then QF gets no revenue, EK might pay QF a small amount for the points earn, but then will charge QF for lounge access.
Whereas if booked under the QF codeshare, I presume that QF gets a portion of the fare charged, which offests the lounge access charge.
QF wants people flying on its codeshares. For elites this is generally done by the chase of Status Credits, for regular Qantas Club members they now have this method as well.