The Maryland House of Delegates on Tuesday approved legislation that would restrict how prosecutors can use a defendant’s creative expression, such as lyrics and art, in criminal and juvenile cases.