The establishment of a barrier between endothelial cell layers, such as those in the brain, lung or intestine, to exert specific and selective control over the passage of water and solutes, thus allowing formation and maintenance of compartments that differ in fluid and solute composition.