That’s covered by section 107 of the US copyright law, and is actually fine and protected as free use in most cases. As long as the work isn’t a direct copy and instead changes the result to be something different.
All parody type music is protected in this way, whether it’s new lyrics to a song, or even something less “creative” like performing the lyrics of song A to the melody and style of song B.