Spiders do not lay eggs inside bananas. The idea that spiders lay eggs inside bananas is an urban legend. On rare occasions, spider egg sacks are found on the outside of bananas, and adult tropical spiders are also sometimes found in shipments of bananas.
Banana flowers are very long, narrow tubes. The banana grows from deep inside the tube. A spider cannot lay eggs inside a banana, but if a spider was able to lay eggs inside a banana, the hatched babies would be unable to get back out of the banana alive, which would defeat the purpose of laying eggs.