This post is nearly 15 years old, but I feel the need to add some missing context here. Stefan Kendall's answer is correct, but a proof is not given. Although it follows directly from properties of trees, it may not be apparent to every reader that this algorithm always works.
Firstly, if the input tree has an odd number of vertices, it is impossible for there to be a perfect matching in the tree since every edge has exactly two endpoints and a perfect matching contains exactly one edge incident to any vertex. However, not every tree with an even number of vertices has a perfect matching.
Algorithm: Identify an edge (u,v) of the forest T which has a leaf u. Delete vertex v from T, and recursively determine if T - v has a perfect matching. As base cases, if T is the trivial graph with no vertices, return true. If T has an odd number of vertices, return false.
Proof: The base cases are justified by above. It is a theorem of graph theory that every tree contains at least one leaf vertex. Deleting the unique neighbor of a leaf from a tree results in a forest. Certainly, if a tree T has a perfect matching and u is a leaf, then the edge (u,v), where v is the unique neighbor of u, must be in the perfect matching. Therefore, if a tree T has a perfect matching and u is a leaf in T with neighbor v, then the forest T' = T - {v} must also have a perfect matching. Furthermore, since every perfect matching must contain edge (u,v), it is also true that if tree T does not have a perfect matching, then T' cannot have a perfect matching. Thus, T has a perfect matching if and only if T' has a perfect matching. Moreover, all the properties of trees discussed above apply to each component of T'. The algorithm relies on these fact to recursively find whether forests obtained by deleting leaf vertices have perfect matchings. The proof of correctness has been implicit in the discussion so far
Additional notes of interest: This algorithm can be easily modified to return the actual perfect matching, if one exists. In fact, our discussion above also proves that if a tree has a perfect matching, then it is unique; thus, every tree contains at most one perfect matching. This is because at each stage of the (modified) algorithm, we guarantee that the edge (u,v) that we add is contained in every perfect matching of the graph that contains it, if a perfect matching exists.