One reason could be that we project our own desires and hopes onto them. Fictional characters give us a way to explore different possibilities and experiences. Plus, the way they are presented, through compelling writing or vivid visuals, makes it easy to form a strong attachment.
It could be that their stories and personalities touch our emotions deeply. Fictional characters can provide a form of connection and inspiration that we might not find in our everyday lives. Also, the well-developed fictional worlds they inhabit draw us in and make us feel involved.