The required torque is calculated basically in the way you would calculate how much force you need to push a triangular shaped door stop between the bottom of the door and the floor. This operation necessarily involves friction that for accurate calculations needs to be estimated. All in all the calculated results are maybe only + or - 25% accurate.
There are simple equations, like the one the questioner provides and there are more accurate ones (below). The questioner's formula is erroneous because it doesn't include the important effect of the screw thread. The "K" in that equation should include friction as well as the helical angle of the screw. I believe this simple form of the equation started with the accompaniment of a figure or chart to look up a suitable value for K, and then it got more simplified, but with knowledge of the basic physics lost.
We can start with that equation, but then write K further as
K = {[(0.5 dp)(tan l + mt sec b)/(1 – mt tan l sec b)] + [0.625 mc D]}/D
or,
K = {[0.5 p/p] + [0.5 mt (D – 0.75 p sin a)/sin a] + [0.625 mc D]}/D
where D = bolt nominal shank diameter.
p = thread pitch (bolt longitudinal distance per thread).
a = thread profile angle = 60° (for M, MJ, UN, UNR, and UNJ thread profiles).
b = thread profile half angle = 60°/2 = 30°.
tan l = thread helix angle tan = p/(p dp).
dp = bolt pitch diameter.
mt = thread coefficient of friction.
mc = collar coefficient of friction.
These expressions contain both the effects of friction and of screw thread. They can be found in the reputable texts, Shigley, Mechanical Engineering Design, 5 ed., McGraw-Hill, 1989, p. 346, Eq. 8-19, and MIL-HDBK-60, 1990, Sect. 100.5.1, p. 26, Eq. 100.5.1, respectively. They may be too much for some people and we can understand the desire to simplify.
I don't have practical experience in comparing these calculations to the real world. It's possible the more complicated expressions are judged not to be worth the effort in comparison to their accuracy. However, in an "Engineering" forum, I think it's important to not lose sight of the fundamental physics.