What is the intended purpose of Haro? What is the original intended function of Haro (both in-universe and in real life)? What did it end up becoming?
Out-of-universe
Haro was included in Mobile Suit Gundam for the purpose of showing Amuro's talent for building machines. However, it fulfills another purpose; that of being a mascot.
Kunio Okawara initially designed Haro for Invincible Steel Man Daitarn 3, and named him after HAL (the computer from 2001: A Space Odyssey)2. It was (likely) intended to be a mascot of the series, before the concept was discarded. However, Okawara was later approached prior to Mobile Suit Gundam and persuaded to include it, allowing it to somewhat serve as a mascot of the series. Since then:

Haro has since become a mascot for the Sunrise studio as a whole, often appearing in their recent idents.
  — Haro, Wikipedia

Because it its popularity and its rank as mascot of the series, Haro has also received a substantial following and quite a collection of merchandise.

In-universe
The in-universe explanation is actually far simpler. Haro was created by Amuro, the main character, as part of his hobby building machines. Amuro generally had few social interactions with others, so he created Haro as a companion to himself, with its speech function and brain-wave analysis functions making it quite a good substitute for a close friend.
References

Haro (character) at Wikipedia
Haro at the Japanese Wikipedia
Series Mascot at TVTropes