Prior to modern treatment, HIV was sadly known not only for its prolonged, eventually deadly illness period, but for the extreme social stigma it endured in the 1980s (and to a lesser extent, even later). But HIV is not unique in either in its transmission mode or disease outcome.
For example, before antibiotics, Syphilis was a long and painful disease progressing to either death or permanent disability in its late stages. While it (together with other STIs) always had some stigma, it never reached the HIV craze of the 1980s. You didn't see syphilis patients expelled from schools, avoided in the streets, refused basic interaction, or being told their disease is a punishment of God (especially those who acquired it congenially rather as a result of their own activities) - all treatments "afforded" to HIV patients in the 1980s. This is despite Syphilis being known even during the most puritanical of times. For example, this portrait is from 1820, implies that the victim, despite his disfigurement, was at least afforded enough courtesy to have their portrait taken.
Hepatitis C is another disease not unlike HIV. It is a bloodborne-only disease (implying transmission primarily via drug use, unsterile tattoo parlors, or very rough anal sex - all historically condemned activities), and before treatment (which was discovered only very recently), was often fatal within 10-20 years (not much longer than HIV in some cases). Yet the stigma for it was little known, and generally Hep C patients lived socially normal lives. Most in the general public wouldn't distinguish between it and other "normal" diseases.
Even diseases which are much more transmissible than the ones above, and which the public, arguably, did have a reason to be more socially guarded against (e.g. Tuberculosis), never had the same hostility towards victims as HIV did.
So what in particular about the AIDS pandemic that led to such a hostile public reaction towards victims, that wasn't expressed towards other diseases, even those with similar transmission vectors or outcomes? Why have HIV patients, singularly so in modern history, have been socially treated like lepers were in ancient times?
As both activists and the scientists involved in AIDS research noted at the time and since, there were two factors that made HIV stigma unique and uniquely severe.
The first was the fact that it was initially reported among groups of people who were already subject to significant social stigma in the early 1980s (gay and bisexual men, IV drug users, and Haitian immigrants); this made it easy for the media and political/religious figures to single out AIDS patients for stigmatization. Of course, this was compounded by the fact that AIDS emerged right as the Reagan Revolution was occurring and the so-called Moral Majority was becoming a powerful force in American politics. In the early days of the epidemic, the media referred to AIDS as GRID (Gay-Related Immune Deficiency), "gay cancer", or the "gay plague", reinforcing the idea that this was a "gay disease", when, of course, it wasn't; it was just a sexually-transmitted disease that happened to affect the gay community first in the US. The later understanding that, in other parts of the world, AIDS was primarily a disease of heterosexual transmission, didn't really do much to change that perception, especially since the early dire warnings of the potential for a large-scale epidemic of heterosexually-transmitted AIDS didn't materialize in the US (and the most severe burden of heterosexually-transmitted AIDS also fell upon historically marginalized communities).
The second was the almost universally fatal outcome, which contributed to the fear among the uninformed general public, and the fact that early on, very little was known about the cause of the illness and how it was transmitted, which only compounded that fear. People were scared for their and their families' safety. The discovery that it could be passed along to the "general population" outside the known "high risk groups" through blood transfusions only exacerbated the fear and hysteria. It took about two years to discover the virus that caused AIDS (although epidemiologists had suspected from the beginning that it could be a virus, because, as you mentioned, its social profile was very similar to Hep B), and it took even longer to prove that it wasn't transmitted through casual contact, which allowed time for fear and misinformation to spread without an authoritative repudiation.
Even once scientists had confirmed and reported publicly that HIV wasn't transmissible through casual contact, politicians and other public figures (including Reagan himself) openly questioned, or at least downplayed the certainty, of that information; in the case of Reagan's public statement in 1985 (which was later revealed by a PBS Frontline investigation to have been prompted by an internal memo from White House lawyer John Roberts, now Chief Justice John Roberts), the director of the CDC, James Mason, came out and publicly repudiated his statement. Other public health figures, including the Surgeon General, C. Everett Koop, and the head of the NIAID, a guy you might have heard of named Anthony Fauci, also made efforts to put good AIDS information in the hands of the general public (Koop went so far as to send his report on AIDS to every household in America without Reagan's authorization in 1988), but the damage was done. There were campaigns for things like quarantining AIDS patients, which were promoted by both fringe groups like the LaRouche Movement and mainstream politicians, as well as the famous cases of HIV-infected children being expelled from their schools due to protests from uninformed parents. And the legacy of that fear is still visible today; take for example the Red Cross' continued deferment of men who have sex with men from blood donation, an artifact of an era before reliable HIV testing was widely available.
So, essentially, it boiled down to a combination of prejudice and fear. The prejudice had always been there, but a disease that seemingly "targeted" socially stigmatized groups provided an outlet for homophobia and bigotry that demagogues weren't going to pass up. The fear was, to an extent, understandable; the emergence of a fatal illness of unknown cause and origin is a genuinely scary thing. However, that fear could have been alleviated if politicians and religious figures had listened to the epidemiologists and virologists and been straightforward with the public about what caused AIDS and how to prevent its spread once that information was known; instead, they equivocated or, in some cases, spread outright misinformation, which increased fear and hysteria when the correct information could have diminished it.
I recognize that this answer was US-centric and I apologize for that, but it's the best-documented example and the one where most of the reporting and subsequent historical/social scientific research has focused; there were similar levels of stigma and prejudice in other countries as well (such as the UK and Australia, as contemporary media reports illustrate).
Source:
National Research Council, The Social Impact of AIDS in the United States (National Academies Press, 1993).
u/warneagle's answer is excellent, and I have very little to add, but I will link you an answer of mine about how AIDS was perceived and how the epidemic progressed in the USSR. While I wasn't trying to address your exact question, I believe I ended up touching on and indirectly addressing the issue of stigma, and it may add some more international perspective, so I hope it helps.