We always say that killing living beings is a sin. But we use silk by killing silkworm and silk is used as part of many rituals. What is the significance then?

It is true that killing living beings is a sin and the Vedas rightly say so. However, in some cases, if the benefit that the person and the society derive out of such a killing is significant, it shall be excused.
During a child’s Upanayanam (sacred thread ceremony), at the time of Brahmopadesam (when the ward is initiated into the sacred Gayatri Mantra) by the father or the Guru, they are covered in a silk cloth. Likewise, silk is also used in other ceremonies and rituals. The reason behind this being, silk has a unique property of retaining the radiations of the Mantras.
Giving a little more thought into it, even consuming certain plants and vegetables (like spinach or greens, tubers etc.) amount to killing lives.
Hence, it is generally accepted that in instances where such a harm is inevitable for survival, do the minimum harm possible.