To find Salesforce Profiles with Password Never Expires permission enabled, we have to use PermissionsPasswordNeverExpires on the Profile object/entity.
Please check the following SOQL which will retrieve all the Salesforce Profiles with the Permission Password Never Expires enabled.
SOQL:
SELECT Id, Name, PermissionsPasswordNeverExpires
FROM Profile WHERE
PermissionsPasswordNeverExpires = true