Other than the fact they are both super-heroes, Strange doesn't know how "important" Peter Parker is, that's an audience thing. Also, Strange states quite clearly that he doesn't really understand the multiverse very well, he pretty much knows it exists, and that's about it. He knew the spell was dangerous, but he's arrogant and figured he could handle it.The spell he did was something he said he had done before so he probably didn't think it would be such a big deal. But the target wasn't a bunch of party goers in Kathmandu. It was Peter Parker, a person that exists across many universes. Perhaps someone who exists more often than most people and whose identity is regularly a big deal. Had the same spell been attempted on the Hulk or Captain Marvel I don't think it would have been as difficult to control.