iOS and Windows Phone don't use that. My point still stands. It was based on Android or Chromium or whatever it's called, even though they worked on modifying it. They didn't code the OS from scratch.
Firefox Gonk Linux probably needed to use the Android HAL, so it would work on the most models of smartphones and smartphone parts which are Android based, and to save time by not needing to code a HAL from the beginning to end which may take months to years.
The Firefox Mobile web browser in Firefox OS is based on the Mozilla Gecko web browser rendering engine which runs Firefox OS, and the apps except for Gonk Linux's Android HAL which is used to control the basic hardware parts' function like GPS, Camera, Bluetooth.
Firefox OS can only run web apps in the web browser. The apps are made with HTML, HTML5, CSS, JavaScript. The Gecko browser is older than both Android and Chromium because Gecko was used in the Netscape web browser which got released in 1997 when Google was not a browser or OS maker, so Gecko does not use any code from Chromium web browser and Android.
Firefox OS most likely use the Android HAL because Firefox OS was designed to be installed on as many somewhat modern smartphones which are mostly designed for Android.
Firefox OS can be installed on Android phones like the Nexus 5 which uses phone parts which are designed to be compatible with Android's HAL.
It would cost a lot of time and money to make custom firmware which work with most phones instead of using the Android HAL which already work on most phones except for iOS phones where the CPU and a few other chips are designed only for iOS.
Making Firefox OS compatible with Android phones let phone users use Firefox OS without needing to buy another phone just to use Firefox OS. It also gives users the choice to go back to Android if Firefox is not working well on their Android phone.
Mozilla probably hoped that some people with Android on their phones would install Firefox OS on their Android phone, and give Firefox OS a try.
Firefox OS may not have lasted as long if Firefox OS did not work with existing Android phones, or it took too long to make a custom HAL, and now there are tons of cheaper Android phones like the Motorola Moto E which run Android at a decent speed.