Here's why:
* It distinguishes it from other text. Underlining helps identify the title visually, making it stand out from surrounding words.
* It's a standard convention. In written work, underlining is the traditional way to format play titles.
Example:
I recently saw a production of *Hamlet* at the local theater.
Note: In typed or digital formats, it's also common to *italicize* play titles instead of underlining them.