The simple answer is that melting pennies and nickels for profit is illegal. This prohibition was enacted by the United States Mint in 2006 due to the face value of these coins being lower than the value of the metal content. The purpose of this law is to prevent potential profiteering by melting the coins and selling the metal. Violations can result in a fine and/or imprisonment. The law only specifically mentions one and five-cent pieces (pennies & nickels). For most other U.S. coins, it is unlikely they’d ever be worth less than the metal they’re made from.
There are, however, exceptions to this law. For example, these coins can be melted for creative uses, such as making jewelry. Even the jewelry can be sold for profit because it is only illegal if you are profiting off the metal itself. For jewelry, there are other elements used, and combined with the labor itself, they justify the profits if sold.