The Senate approved legislation that would empower the government to provide $1.3 billion worth of emergency food and housing, health care, education and other help to the nation's homeless people over the next two years. The House passed a similar measure last month. Negotiators from the two chambers will have to compose a compromise bill that would have to be approved by both chambers before it is sent to the White House for President Reagan's signature. The legislation was approved by a voice vote. It would extend for two years a law that otherwise would expire with the end of the 1988 federal fiscal year this Friday. The bill would allow the government to provide money to states, municipalities and private agencies for rental assistance, health care, mental health services, alcohol and drug abuse programs, education and job training projects.