The term was originally used to say "Good bye", "greetings" or any other valediction (by the way, it's worth to note "valediction" comes from "vale" and "diction": to say good bye). This meaning dates back to Latin:
Vale "farewell!," second person singular imperative of valere "be well, be strong" (Etymonline)
Already existing in Latin, it was used in Spain a couple of centuries ago to say "good bye" to someone and to close a letter. It's interesting to note that the last word of Don Quixote is "Vale":
...pues no ha sido otro mi deseo que poner en aborrecimiento de los
hombres las fingidas y disparatadas historias de los libros de caballerías, que, por las de mi verdadero don Quijote, van ya tropezando, y han de caer del todo, sin duda alguna. Vale.
Later on, "vale" obtained the connotation of closing something, as when leaving. According to the CVC forum, the academic Fernando Lázaro Carreter explains in his book El dardo en la palabra that the term was used some time ago (around the 70's) to tell someone to stop doing something. Then, the term gained its new meaning:
Se ha forjado sobre el ya vale (o, simplemente, vale) con que pedimos que se interrumpa una acción en curso: «(Ya) vale de bromas»; «No eches más, vale»; «Vale, no sigas». De este empleo [...], se ha extendido al moderno.
From there, it isn't hard to imagine how the meaning of "vale" as a interjection shifted from "closing", "ending" or "conlusion" to mean "agreement". When dealing, the second part may say "vale" to what the first part proposed, thus saying that the deal is sealed or closed. Hence the meaning of "vale" as "okay".
In conclusion, the term developed from Latin valere or Spanish valer, but nowadays it's lost the meaning of being "valuable" or "worth", so it shouldn't be considered a form of the verb "valer", but rather a mere interjection:
Vale 1. interj. U. para expresar asentimiento o conformidad.
EDIT: Interestingly, there seems to be an alterantive meaning, just as common as the aforementioned, that the RAE does not include. As Lázaro Carreter explains (see link above), vale is also used as an interjection to interrupt an ongoing action or express there's enough of something, commonly found embedded in other expressions such as así vale, ya vale or vale ya, and previous to the sense commented here. Such meaning doesn't fit with the idea of "agreement" or "conformity". Whether this second sense of the term is related to the verb valere or valer (i.e., being enough value of something) or not, is hard to tell.