* The logos might be under a free license
* The logos might not even be shipped (not a big deal for Perl and Python, which are primariliy command line applications)
* The trademark protection only includes the name, not the logo, and so it doesn't force the owner to defend its usage to keep the trademark.
For example https://www.drupal.com/trademark mentions a drupal icon which is subject to traemark, and a logo, which is not (unfortunately the log link is a 404).
Yeah, Drupal has the wordmark branding and the community branding as separate things. I just brought up these examples because all of them have Debian packages that apparently have no issues being named after the project but there are of course numerous others.
Mozilla protected more agressively its Firefox brand to cope with malware-stuffed clones which were hijacking the name.
Projects such as VLC or Android protect their brand too, Chrome is only available through official closed-source builds, many linux distributions only package chromium.
VLC is still gets packaged by Debian as VLC and even branding intact I believe. Chrome is a little different since you can't even build it so Debian's interest in including it instead of Chromium isn't probably all that high anyway.