The text of the proposition is:
All efforts which we make through reason are nothing but efforts to understand, and the mind, in so far as it uses reason, adjudges nothing as profitable to itself excepting that which conduces to understanding.
Demonstration. The endeavor after self-preservation is nothing but the essence of the object itself (3P7.), which, in so far as it exists, is conceived to have power to persevere in existence (3P6.), and to do those things which necessarily follow from its given nature. (See the definition of desire in 3P9s..) But the essence of reason is nothing but our mind, in so far as it clearly and distinctly understands. (See the definition of clear and distinct understanding in 2P40s2.). Therefore (2P40.), all efforts which we make through reason are nothing else than efforts to understand. Again, since this effort of the mind, by which the mind, in so far as it reasons, endeavors to preserve its being, is nothing but the effort to understand (by the first part of this Demonstration), it follows (4P22c.), that the effort to understand is the primary and sole foundation of virtue, and that (4P25.) we do not endeavor to understand things for the sake of any end, but, on the contrary, the mind, in so far as it reasons, can conceive nothing as being good for itself except that which conduces to understanding (4D1.). Q.E.D.
The beginning of this demonstration makes sense: the essence of any object is its striving to persevere, which follows clearly from 3P7. "Reason" is defined in 2P40s2 as the formation of universal ideas "From our possessing common notions and adequate ideas of the properties of things." This is also fine, I suppose.
What I don't understand is how this makes reason "the sole foundation of virtue," since presumably there are other efforts by which the mind strives to preserve its being. For example, anything we do that brings us joy involves a movement to a greater stage of perfection (i.e. "preservation"), and Spinoza allows plenty of things in part three other than understanding that bring us joy. So it is hard to see how this is not just the primary, but in fact the sole foundation of virtue. Any ideas?