Mainly to identify whether you lied about your previous income on your resume and interview, and also give you a salary as a reference. There is no prohibition in the law, so it is legal for the company to make this request. The employment process is formulated by each company under the premise of abiding by the law, and the regulations of each company are different, but it is customary to provide proof of income.
If you didn't lie during the interview, you might as well provide it to the new company. You can refuse, but it will affect the employment decision of the new company. If you want to work in this new company and you want to be happy in the future, you might as well offer it to them.