LM339 is open-collector so R7 is required (or at least, good practice in a real circuit). For the simulation it may be more important since it needs a number to work with and a floating copper wire can't be handled numerically.And also R7 shouldn't be required but it won't simulate without it.
You're missing the point. D12 has nothing to do with it. Tell me, what voltage do you think the simulator should assign to the output of LM339 is not outputting a LO (i.e. when the output goes high impedance).Yup, but it's draining D12. I'd not do it in a circuit here unless using a FET.