Batman, as a character and the associated intellectual property, is owned by Warner Bros. Discovery, which acquired DC Comics (where Batman was created) in 2022.
While Spider-Man is part of the Disney-owned Marvel Cinematic Universe (MCU), the film rights to Spider-Man are owned by Sony, not Disney.
Disney owns Marvel Studios and Marvel Comics, which means they own the rights to the character Spider-Man in comics and animated cartoons.
Disney acquired Marvel Studios in 2009, meaning they own the rights to the Hulk character and his appearances in other Marvel films.
Marvel Entertainment, a subsidiary of The Walt Disney Company, owns the rights to Captain America and his associated character, Steve Rogers.