It's easy for CS teachers to get boys excited by introducing a new topic with something like "these algorithms are important in VIDEO GAMES!" Boys are vastly more likely to play video games than girls, so this example will likely be much more motivating to boys than girls.
Girls are often socialized to highly value a career that helps other people. An example like "these algorithms are important for helping doctors determine which patients have cancer" may be more inspiring to them.