That's the top wall plate, and it's certainly structural. (Maybe you meant "load-bearing", which it apparently isn't.) You can simply cut it flush with the stud faces and fill in the drywall, adding floating backing over the ceiling where needed. I'd use a reciprocating saw, but a small hand saw will work. You could also drill a series of holes against the stud to cut the plate off, then use a sharp chisel to trim off any protruding wood. A 1/2" or 3/4" spade bit would work well.
Interior walls (except in basements) usually have doubled top plates, but this closet may have been added later. It looks like there's just the one.
I suggest a little study into basic framing techniques before you proceed. Hopefully you haven't removed a bearing header.