Is the Nearest Neighbor Algorithm a valid algorithm to find a Minimum Spanning Tree?
Your algorithm starts at some vertex and then always move to the closest vertex that's not been visited so far. That's not guaranteed to find the minimum spanning tree, as the example in your question shows.

First, in a general graph, the algorithm might get stuck: you might end up at a vertex where you've already visited all the neighbours.  For example, if you start your algorithm at&nbsp;$D$, it will go to&nbsp;$B$, then&nbsp;$C$ and then it's stuck because it's already visited both of $D$'s&nbsp;neighbours. The set-up of Hamiltonian cycle avoids this possibility by having an edge between every pair of vertices.

Second, even if your graph contains every possible edge, the algorithm can only produce a path, so it won't produce the minimum spanning tree in any graph where the M.S.T. isn't a path.  For example, take vertices $\{1, \dots, n\}$ with $w(1,i)=1$ for all&nbsp;$i$ and $w(i,j)=2$ for all $i,j\geq 2$. The M.S.T. is all the edges from&nbsp;$1$, and this has weight&nbsp;$n-1$. But your algorithm will find some path that uses only one or two of the weight-$1$ edges, so will have weight $2n-3$ or $2n-4$.