disney bought the rights for spiderman from sony
Not quite. Sony still retain all rights but have come to a unique deal to collaborate with Disney/Marvel. They'll both get access to the same character, and can share other associated characters too.
Sony retains marketing control and will get a good amount of money from merchandising.
It's quite a mutual agreement. Sony gets more money with less risk (and retain their cashcow), while Marvel gets access to their star property again and can use him to boost their own projects down the line.