Why is Borax used as a primary standard? It's given in my book that borax is a useful primary standard for titrating against acids. I have heard that primary standard is a pure reagent and does not gain any weight by absorbing moisture. (Hence any error during weight measurement is prevented). 

I got this from a website that came first on searching "primary standard" 


  Primary standard is a reagent that is extremely pure, stable, has no waters of hydration, and has a high molecular weight .


But borax (represented as $\ce{Na2B4O7.10H2O}$) has water of hydration.
Yes borax is a hydrate, but the reason it is favored for titration is that it gives consistent results, which to most scientists, is far more important than accuracy.  

The $\ce{ .\!10H2O}$ hydration number will remain constant and will not fluctuate to $\mathrm{11}$ or $\mathrm{9}$ within normal temperature and humidity ranges. This means that per mass the same amount of sodium ions are dispensed every time and gives the same results time after time and experiment after experiment even with different batches of powder. Also the tetraborate conjugate base is very weak, which is ideal for a titration agent as well.