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 suspect that you might have buttermilk, as recognized in Southern Asia and the Middle East. There, it sounds like they do just what you did, and then process it. Did you smell it? Did it smell sour, or rotten?
The Wikipedia entry for "Traditional Buttermilk" will clarify what you have. Here is an excerpt:
Originally, buttermilk referred to the liquid left over from churning butter from cultured or fermented cream. Traditionally, before the advent of homogenization, the milk was left to sit for a period of time to allow the cream and milk to separate. During this time, naturally occurring lactic acid-producing bacteria in the milk fermented it. This facilitates the butter churning process, since fat from cream with a lower pH coalesces more readily than that of fresh cream. The acidic environment also helps prevent potentially harmful microorganisms from growing, increasing shelf-life.
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.