Why, exactly, is the state of Israel and the United States of America so strongly connected to one another as political allies? What brings these two countries together?
The answer is very complicated, since there are a variety of interconnected reasons. For instance, domestic lobbying can spring from ideological or religious sentiments. That said, here are the main reasons, not necessarily in order of importance.
Geopolitical or military advantage
Essentially, countries, especially militarily active ones such as the United States, seek to have military allies across the world, but particularly in regions where they have strategic interests.
Initially, Israel was a reliable ally against the Soviet Union:
Although Israel frequently is referred to as an ally of the United States, technically Israel may not fall under the definition of "ally" because there is no mutual defense agreement between the two countries. The Reagan Administration considered Israel a "strategic asset" because of Israel's opposition to the Soviet Union. Israel's Defense Minister Ariel Sharon and Secretary of Defense Caspar Weinberger signed a memorandum of understanding (MOU) on November 30, 1981, establishing a framework for continued consultation and cooperation to enhance the national security of both countries and confront the Soviet threat. (On December 18, 1981, the State Department announced the "suspension" of the MOU in reaction to Israel's annexing the Syrian Golan Heights.)
Israeli-United States Relations, Clyde R. Mark, Congressional Research Service
With the rise of international terrorism, much tied to groups that espouse Islamist ideologies, the US and Israel have found common ground again:
Following the March 15, 1993 White House meeting between President Clinton and Prime Minister Rabin, a White House spokesman said the two leaders agreed to upgrade the U. S.-Israel strategic dialogue. Also, Israeli sources, official and unofficial, offer warnings and advice about confronting the threat of Islamic fundamentalism, always picturing Islam as the enemy of the West and the United States. It appears as though Israelis want to maintain their status as strategic ally by creating an Islamic adversary to replace the Soviet nemesis of the past. Following the terror incidents of February-March 1996, President Clinton announced that the United States and Israel would sign an agreement for closer cooperation in anti-terror and other strategic matters.
Israeli-United States Relations, Clyde R. Mark, Congressional Research Service
The United States, obviously, has often attracted the ire of these groups for its actions in the Middle East. So has Israel, whom these groups sometimes also oppose because of anti-Jewish beliefs. In addition, many of these groups receive support from nations that are also unfavorable to Israel. As such, US and Israeli leaders have often perceived their military and strategic interest to coincide once more.
This sort of interest frequently overcomes barriers such as cultural or ideological differences between regimes, distance, and so forth. Nazi Germany was willing to ally with the Soviet Union, despite fascism and communism being rather dissimilar; later in World War II, the Soviet Union would ally with the United States, again despite the US being a capitalist country.
More to the current point, the US is also allied with Saudi Arabia, despite them having less in common than with Israel, at least until recently1: monarchy instead of democracy, more restrictive rights for women, a religion that's more stigmatized in the US, possibly greater cultural dissimilarities.
Ever since the modern U.S.-Saudi relationship began in 1945, the U.S. has been willing to overlook many of the kingdom’s less savory aspects as long as it kept the oil flowing and supported U.S. national security policies.
This illustrates that the military rationale is not limited to Israel. The US has substantial military and non-military objectives in the Middle East, and will likely engage in some measure of cooperation with any country that will support those objectives. Since some of these, such as containing Iran's nuclear program, agree with those of Israel (and other countries), the US has allied with those countries, whatever their other disagreements. As such, this may well be the most important reason.
Israel is more similar in some respects to the United States than many other countries in the Middle East. As frequently cited by its boosters, it is either the only democracy in the region, or one of two along with Tunisia. The US is fairly democratic, and strongly identifies with being democratic: this might help encourage an alliance with Israel (do note however the previous point, since historically realpolitik concerns have tended to outweigh this).
Israel also scores relatively high on indices of LBGT rights and gender equality, which again motivates some Americans to see it as more ideologically similar.
On the other hand, more ugly motivations underlie the support of some individuals. Israel is also of more directly European descent, and more European culturally, than the rest of the Middle East, which influences some people explicitly or unconsciously. For instance, people prejudiced against Latinos sometimes support in Israel's actions against Palestinians, as seen in some recent statements that favorably compare Israel's walls to Trump's proposed wall.
As I elaborated in my answer to a related question, evangelical Christians, a large and vocal voting bloc in the United States, have frequently viewed Israel as important to end-times prophecies, as well as viewing Judaism as ideologically similar to their beliefs. Powerful evangelical leaders such as Jerry Falwell have voiced support for Israel. As such, a subset of evangelicals view support for Israel as religiously mandated—in some cases, regardless of the issue.
Although Jews form a much smaller percentage of the US population than evangelical Christians, they are often more aware of issues surrounding Israel, and possibly more active. American Jews have a wide diversity of opinions on Israel, which often vary depending on its government and policy; however, significant numbers are uniformly supportive toward Israel regardless. According to a poll, 73% of American Jews said that "US should support Israel", compared to 17% who said that the US should support both equally, and 9% who said they were not sure (possibly this slice would include individuals who wouldn't feel like they should support a country rather than governments or issues).2
Overall, one also cannot dismiss the influence of Islamophobia. Some people, from various groups, support Israel because of antipathy to Islam generally, seeing Israel as a bulwark against Islam in the Middle East. With the election of Netanyahu, a hardliner, this percentage has likely grown larger and more vocal.
Since all these people cast votes, and some engage in lobbying or activism or even are elected to polical office, their beliefs will influence the general attitude of the US toward Israel.
Other religious groups have reasons that might lead them to support Israel: for instance, some Hindu fundmentalists might be motivated by anti-Muslim beliefs. There may even be some religious Muslims who would advocate for a relationship with Israel. However, at the current time, all these contributions are likely smaller.
Lobbying and activism
Like many countries and interest groups, people sympathetic to Israel lobby in American politics. This can't entirely be separated from any of the previous sentiments, but it can both increase their popularity and ensure that people who endorse them are more likely to win. As with most campaign money, the effect is less to persuade individuals who are already in office, or even ensure the loyalty of individuals who have previously been supported, but rather to ensure that individuals sympathetic to one's cause are elected.
Much of Israel's support from lobbyists and donors is not direct. Depending on how one counts, the amount differs. The Sunlight foundation suggested that its direct spending was a measely $1255. Opensecrets.org found Israel at #4 with over $20 million, although its ranking seems gone up to #2 recently; presumably the difference between these numbers and those of the Sunlight Foundation is found by counting foreign nationals and businesses not directly affiliated with the Israeli government, such as Israeli citizens living in the US. This all suggests that the majority of campaign spending to promote support for Israel comes from individuals and interest groups, again partly motivated by the previous factors. Although Israel does not control these groups, nor are they entirely separate.
Nonetheless, this lobbying likely helps grant an advantage to candidates who will pursue policies favorable to Israel. This is likely most effective in primaries.
1: Under Benjamin Netanyahu and Donald Trump respectively, the administrations of the US and Israel have become more hostile to democracy; further while bin Salman has not shown a desire to relax Saudi Arabia's autocracy, he has changed certain laws in a manner that brings the country closer to the US.
2: The poll suggests that 0% of American Jews would agree with the statement that the US should support Palestinians. This does not mean that no Jews in the US have this opinion; rather, it means either that no respondents in their sample picked this answer, or that the percentage was below some cutoff (such as 1%) or their margin of error (likely 3%).