Yes, it is legal for you to sell the upper to a MD resident. Uppers are non-regulated.
The comments above mine allude to the buyer's conduct, in that we suffered a "firearm safety act" in 2013 that disallows lightweight uppers on post-2013 lowers. If the buyer has a pre-2013 lower, he can put any kind of legal-length upper on it, as the lower is grandfathered in and can legally receive a lightweight upper. If the buyer has a post-2013 lower, he is not allowed to make a banned firearm out of it by adding a lightweight upper.
This is all rather esoteric and serves only as another toe-hold to incrementally infringe the citizen's 2A rights, and is so difficult to enforce that enforcement will likely only occur as an add-on offense if something else happens. Because of enforcement challenges, and the obvious conflict with the US Constitution, many folks don't pay much attention to this latest bullshit by Maryland's General Assembly (of asses).
The buyer's conduct following the sale has nothing to do with you, as a seller.