I get raw milk and to somehow pasteurize it, I boil it. The milk strongly curdled showing that it is spoiled and rotten (definitely, not suitable for drinking). Is it totally bad milk and I should throw it away? or it still can be used for making yogurt and cheese?
Even if it is possible, it is a very, very bad idea as you don't know what cultures or pathogens are in the already spoiled milk.
Fermented dairy products should only be made from fresh milk in good condition—and in most cases, that milk should be pasteurized while fresh absolutely as soon as possible from the source cows.
I have found that if the milk has completely separated on its own into curds and whey, the whey can be used to cook grains or as a soup base, where it will be boiled. I also pour off the whey that collects on top of a tub of yogurt as it gets used, and add that to my grain-cooking water. The curds, however, smell funky and and I haven't had good results utilizing them. They don't automatically make ricotta.
I've been boiling spoiled milk, separating the sponge like solids and eating them all my life. I find them delicious, and never experienced any adverse effects. I expect it does depend on the way the milk got spoiled. I often add a bit of yogurt to the milk when I suspect it may be a bit off, then let the yogurt bacteria breed in it for a while before boiling. I guess it could be dangerous, but so far I'm happy with this procedure.
If you see your boiled milk is spoiled not to worry. Refrigerate milk for a few hours and then strain water completely. Once this procedure is complete you will see small cheese remains; then add some sugar for taste and cook it for 10-15 minutes until the water is exhausted. Your yummy cheese sweet dish will be ready to serve.