There is nothing inherently wrong with draping a casket with an American flag prior to and during a funeral service from a Jewish perspective. While there are rules about how the type of materials used for the casket (preferably, a plain pine box), I would say that the practice of covering the casket falls into the category of minhag, custom. Customs differ from place to place and often depend on context. In some Jewish communities a plain material cover is placed on the casket. This cover will have verses from the Bible or Jewish symbols on it such as a Magen David. While such a cover was not required, it is permissible to use such a cover.
Military funerals have taken place in a Jewish setting for decades and the practice of draping an American flag on the casket is a common practice, today among rabbis of all movements. While some rabbis discourage burying Jewish service members in military cemeteries, and some may refuse to officiate at a funeral that takes place in a non-Jewish cemetery because there are many Jewish laws and customs governing the burial of Jews separately from non-Jew, burying someone in a Jewish cemetery with military honors is different.
In correspondence, the chair of the Conservative Movement’s Committee on Jewish Law and Standards has suggested that rabbis ask that the military elements of the funeral be separate from the Jewish elements because “we do not combine war and religion,” but again, this is a suggestion and not a law. (1997) Rabbi Harold L. Robin, director of the Jewish Chaplains Council about all of these issues and he said, "In short there is no aspect of a veteran’s funeral that would [necessarily] conflict with Jewish rites or halakhah and no need for compromises." (www. myjewishlearning.com/ask_the_expert/at/Ask_the_Expert_Military_Funerals.shtml)
It is interesting to note that military honors were accepted by all the clergy of all denominations during the Second World War, when Reform, Orthodox and Conservative military chaplains worked together to address issues about how such funerals were to be conducted as well as other questions of religious concern. Apparently, a generation or two ago there still was an understanding among American Jews that there is room for diversity and respect regarding different practices in our community.
From my perspective, those who have served our nation deserve to be recognized and honored as part of their funeral service if they so wish or if their families express a desire for such a ceremony. The flag, simply draped over a casket, and its presentation, to the next of kin with the playing of taps is a deeply moving ceremony that does not subtract from the ‘religious service.” I have found that the military personnel who show up for this ceremony are always flexible and respectful of our traditions and are willing to do whatever the rabbi or family aspects of them. As my colleagues have written, we believe that dina d’malkhuta dina, that “the law of the land is the law for all citizens,” is very much in in keeping with Jewish ethical and spiritual values.
Being buried with military honors demonstrates a passion and zeal for one’s country. Jews who serve in the military show patriotism, love of country, and dedication to the country’s values, and all of that is absolutely consistent with Jewish values and customs. Draping the casket with the flag is neither an idolatrous act nor inconsistent with Halachah.