Specific sponsorship ie a company sponsoring a project and having mention/logo/link on a readme/sponsors page etc I think is quite acceptable.
A random Google ad (particularly with the privacy invasive tracking that goes with it) on the page is going to give an altogether different appearance, particularly if the project is using free resources such as GitHub/read the docs/etc.