Why are fossils formed in sedimentary rocks?
They are not.
Ok so there is a little bit of misunderstanding here.
Fossils are never formed in sedimentary rocks, they are only preserved. So the reason we tend to see fossils mainly in sedimentary rocks is because if you have some type of marine life die, it will sink to the bottom and eventually become covered in sediment. This process takes a long time and eventually will make an imprint in the sediment. This imprint can be replaced by other minerals and then the sediment (which has now become a sedimentary rock) can be exposed. Then we will see the fossil in the sedimentary rock.
Though, you can have fossils in igneous rocks, but it is much much harder to preserve. Igneous rocks have a molten temperature of anything from
The most common type of fossil in an igneous rock is something we call an enclave. It isn't really a fossil but it is a foreign piece of rock that gets taken up by another molten rock, so you have a main rock with an enclave of a different type of rock.
This is a great example of diorite (darker material) enclaves inside a granite.
If you follow the Link, Ron Wolf has a pretty neat explanation of how this rock formed.