Himem.sys provides access to extended memory using the XMS api. Several software packages require this, including MS-DOS itself and Microsoft Windows.
The other answers are correct implementing himem.sys as a device driver allows it to be loaded before other device drivers, including emm386.exe which requires himem.sys to be loaded first. However parts of MS-DOS (starting with version 5.0) can be loaded in the HMA, which would happen after himem.sys is loaded, so it is possible to move code within memory. However, this might be something complicated to do. So this only happens with known code. Which is is fine because there only room for one 64Kb segment in the HMA.
Before MS-DOS 5.0, Windows 2 was another Microsoft product that could load itself in the HMA. It was the first product to include himem.sys. It also included ramdrive.sys and smartdrv.sys which both could use extended memory without himem.sys loaded first, but later versions do need himem.sys to be loaded first. However, a readme file included explicitly states that himem.sys should be loaded first to make sure enough extended memory is availible to use the HMA. So that would be a more specific reason that himem.sys was implemented as a device driver, to allow it to be loaded before ramdrive.sys and smartdrv.sys. However, if both where implemented as a TSR, I don't see a reason why himem.sys could not be implemented as a TSR as well.
Windows 95 actually included a program called xmsmmgr.exe. This was more or less an implementation of himem.sys as an TSR. It was loaded when setup was started from MS-DOS when himem.sys was not loaded. Setup ran, just like previous Windows versions, partly in Windows which would require extended memory. So it is possible to implement himem.sys as a TSR and there would be a good reason to do so. Otherwise it would have to copy himem.sys to the hard drive, change config.sys, reboot, and then start setup again. Or would ask the user to do this. Both these methods could fail in many situations. It may also break some applications if the setup was aborted or the computer was restarted in previous DOS mode.
It would also be possible to implement the himem.sys functionality as a part of the MS-DOS system files (io.sys and msdos.sys). However this would make those files a little bigger and might require more memory if extended memory is not needed or is not present. Or if a different memory manager is required, for example a newer version of himem.sys which is supplied with a version of Windows that is newer than the installed DOS version. Eventually Microsoft did combine the MS-DOS system files and himem.sys into one file in Windows ME.