The HomePod remembers previous songs to help Apple Music identify music you enjoy. You can follow these steps to ensure your HomePod does not stream music marked for explicit language.
Open the Home app on your iOS device. If you do not have the Home app installed it can be downloaded from the Apple App Store. In the Home app select the HomePod you want to access, then tap Details. From here you can disable Allow Explicit Content. Now your HomePod will not play songs or albums marked for explicit content.
Only the person who initially set up the HomePod can access the settings on their connected iOS device.
Apple follows the RIAA standard to determine which songs should be marked with explicit content. Music that contains "strong language or depictions of violence, sex, or substance abuse to such an extent as to merit parental notification," will be marked as explicit in iTunes.