Yes.
In your first case, you chose such that U may or may not be a subspace. By definition of orthogonal complement, is a subspace. So is also a subspace (of ), and we know and in fact is the subspace spanned by U.
For your second case, you chose to start with which is a subspace of , so is the subspace spanned by , but that implies equality based on the definition of spanned.