The Senate has failed to pass a measure that would reopen the government and allow federal workers to be paid.