The Green Goblin could be a main antagonist. He's known for causing chaos in New York City, and a building collapse would be right up his alley. He could be targeting the building for some strategic reason, like trying to get to Peter Parker or to create general mayhem.
One possible plotline could be Peter Parker using his spider - abilities to rescue people trapped in the collapsing building. He might swing in and out, carrying people to safety one by one. Another could be that Peter has to deal with his secret identity while trying to save the day during the building collapse. For example, he has to find a way to change into his suit without being noticed, or he might be recognized by someone he knows while in the middle of the rescue operation.
One possible reason could be overexertion. Peter Parker is often depicted as taking on a lot of responsibilities both as Spider - Man and as an Avenger. He might be pushing himself too hard in a fight or during a mission, leading to a collapse. Another reason could be some sort of external attack that affects his physical or mental state, like a new type of villain's weapon that drains his energy.
He could be trying to save someone. Maybe a civilian is falling from a higher floor, and Peter jumps off to catch them and use his webs to swing them to safety.
The plot may develop with his enemies taking advantage of his weakened state. They might try to attack him while he's in the hospital or at home recovering. On the other hand, his allies, like the Avengers if they exist in that fanfiction world, could come to protect him and help him figure out what caused the collapse in the first place.
One interesting 'Peter Parker under building' fanfiction could be about Peter using his spider - abilities to save people trapped under a collapsed building. He might have to overcome various obstacles like unstable structures and limited visibility.
The other Avengers would likely be very concerned. They might immediately stop whatever they are doing to tend to him. For example, Tony Stark could use his technology to try and figure out what's wrong with Peter. Captain America would probably be the one to keep everyone calm and organized while they figure out a plan to help Peter.
Tony Stark might immediately rush to his side and start scanning him with his high - tech gadgets to find out what's wrong. He'd be worried as he sees Peter as a sort of protege. Captain America would probably be more of a calming presence, trying to keep everyone else from panicking while waiting for medical help if needed.
Obviously, Peter Parker is the main character. But often, we might also see characters like Mary Jane. She could be worried about Peter when he's under the building and might try to help in some way, like getting in touch with other superhero friends of Peter.
Perhaps in this fanfiction, Peter has some new power or gadget that he's testing. So when he jumps off the building, instead of the usual web - swinging, he activates this new ability which allows him to fly or at least glide to the ground in a very cool and unexpected way.