One possible reason could be that Snape is still holding a grudge against James Potter, Harry's father. He might take out his long - standing anger on Harry. Another reason could be that Snape is trying to discipline Harry in his own strict way, but it ends up being too harsh and making Harry cry.
Maybe Snape suspects Harry of being involved in some sort of dangerous activity related to the Dark Arts. Pressing him to the wall could be a way to force Harry to come clean about his actions or any knowledge he might have. It could also be that Snape is acting out of his own insecurities and pent - up emotions towards Harry, which he has been suppressing for a long time.
One possible reason could be that Snape is trying to intimidate Harry. He has always had a rather tense relationship with Harry in the original story, and this could be an extreme form of showing his authority. Maybe he suspects Harry of something, like being involved in some mischief or having knowledge about a certain Dark Arts item or activity.
One possible reason could be to protect Harry. Snape might believe that by tying Harry to the bed, he can keep him in a safe place away from immediate danger. Maybe there's a threat in Hogwarts or outside, and Snape thinks this extreme measure is necessary to ensure Harry's safety.
Maybe Snape has some sort of premonition or knowledge that Harry is going to be crucial in the fight against dark forces in the future. So, in order to ensure that future, he steps in to save Harry from whatever danger his parents' situation might put him in. He might also be trying to atone for past mistakes or grudges he held against Harry's father by protecting his son.
One reason could be to save him. Maybe Harry is injured during a battle or some sort of magical accident, and Snape, despite their differences, steps in to carry him to safety. For example, if Harry is hit by a dark curse and Snape, with his knowledge of dark magic, knows he needs to get Harry to the infirmary quickly.
One possible reason could be Snape's long - held grudges and resentments. He has a complex history with Harry's father, James Potter. Snape might see too much of James in Harry and be unable to separate the two, thus rejecting Harry despite any potential father - son connection. Another reason could be Snape's own self - loathing and his belief that he is not worthy or fit to be a father figure. He may think that he would only bring harm or a bad influence to Harry's life.
In some fanfics, Snape might punish Harry because of his perceived insolence in class. Harry has a rebellious streak, and Snape, being strict, wouldn't tolerate any behavior that he deems disrespectful to his authority as a teacher.
Maybe in the fanfic, Snape is written as having some hidden, truly evil motives that Harry discovers, leading him to kill Snape. For example, if Snape was secretly working for a new dark force even worse than Voldemort.
One possible reason could be his lingering resentment towards James Potter, Harry's father. Snape and James had a long - standing feud during their school days. Since Harry looks a lot like James, Snape might be transferring his old grudges onto Harry.
One possible reason could be that Snape, despite his enmity with Sirius, has a sense of duty towards Hermione as a student at Hogwarts. He might not want to see any harm come to her, even if it means protecting her from Sirius. Another reason could be that Snape has his own complex motives and perhaps sees Hermione as an important asset to the wizarding world, so he steps in to keep her safe.