Answer:
Because they are very far away from Earth and are not point source of light
Step-by-step explanation:
We know that the stars emit their own light while planets reflect the light of the Sun/star. If the source of light is a point, the light will emit in all direction and no rays will be parallel but we know that neither stars nor planets are point object. So light will be emitted out from each point. This makes the divergence less apparent.
Also the distance between the stars/planets and Earth is huge which makes the light rays to appear parallel as the divergence is too little to be observed.