Berkeley Supernova Ia Program - I. Observations, data reduction and spectroscopic sample of 582 low-redshift Type Ia supernovae