Blood is only regarded as najis (impure) when it is shed and comes out. When it is still inside the body and veins of the animal, it is not najis.
Shaykh al-Islam [Ibn Taymiyah] (may Allah have mercy on him) said:
We do not accept that blood before it emerges is najis. There should be evidence for its being najis, and there can be no comparison between blood when it comes out and blood that is still inside the animal, because we say that the evidence for its being taahir (pure) can be demonstrated in many ways:
Impurity is that which is regarded as dirty and filthy. This description is not attributed to these types of things except after they leave the place where they are meant to be. So describing them as najis is inappropriate.
The requirement with regard to anything that is najis is that it must be avoided in prayer. This is not applicable to blood and other things that are inside the body.
The blood that they regard as dirty inside the body is one of the basic requirements of the animal without which it cannot survive, and it may be said that the animal is alive because of it. To suggest that Allah has made one of the essential elements for life of both people and animals something that is impure is highly unlikely.
Moreover, the basic principle is that things are pure, and cannot be proven to be impure except on the basis of evidence, and there is no evidence to prove that this blood which they regard as dirty is najis. End quote.
Majmoo‘ al-Fataawa, 21/598-600
Ibn al-Qayyim (may Allah have mercy on him) said:
Waste matter only becomes regarded as urine and stools when it departs from the place where it is held, at which point it becomes regarded as impure; otherwise, so long as it remains in its rightful place, it is still food and drink that are clean and not dirty. Rather they become dirty after they are expelled from the body. The same applies to blood: it is only impure when it has been shed and has left the body. But if it is still inside the body and veins of the animal, then it is not impure. End quote.
Badaa’i‘ al-Fawaa’id, 3/641
If we assume that blood is impure even when it is in its rightful place, before it leaves the body of the person or animal, then maniy (semen) is still pure even if it is generated from blood. That is because it is transformed, i.e., it has changed from its original state of blood into something with different characteristics, so it becomes pure through this transformation. What matters here is not the origin from which it is transformed; rather what matters is the characteristics that it has now, at the time the verdict is given on it.
Shaykh al-Islam Ibn Taymiyah (may Allah have mercy on him) said:
If we assume that blood is impure, then it has transformed and changed. As for their view that transformation does not purify, our answer is: the one who issued this long-winded fatwa has gone against scholarly consensus, because the Muslims are unanimously agreed that in the case of wine, if Allah has caused it to begin to change into vinegar, then it has become pure. The same applies to the transformation of animals and plants. Indeed, I say: Observation shows us that everything that Allah causes to change and transform from one thing to another, such as turning wine into vinegar, blood into semen, the ‘alaqah (blood clot) into the mudghah (lump of chewed flesh) [this is a reference to stages in the development the foetus], the meat of the animal that eats filth into meat that is good and pure, and the same applies to its milk or eggs, and crops that are irrigated with something impure becoming pure if they are irritated with pure water, and so on -- in all of these cases the ruling of impurity is no longer applicable and the fact of impurity and the name are no longer applicable. This is something clear and indisputable. All physical creations on earth may be transformed by Allah from one thing to another, and no attention is to be paid to their elements and components.
Majmoo‘ al-Fataawa, 21/600-601
Ibn al-Qayyim (may Allah have mercy on him) said:
When something good and pure turns into something bad and impure, it is deemed to be najis, such as water and food when they turn into urine and stools. So how come we agree on the fact that something pure can be turned into something impure and do not agree on the opposite of that? Allah brings forth good and pure things from bad and impure things, and bad and impure things from good and pure things. The origin does not matter; rather what matters is the characteristic of the thing itself. It is not logical for the ruling of impurity to remain when the name and characteristic of impurity is no longer there. The ruling is connected to the name and characteristic, and changes with it, according to whether it is there or not. End quote.
I‘laam al-Muwaqqi‘een, 2/14
With regard to the purity of maniy (semen), see the answer to question number 2458.
And Allah knows best.