The arrest last week of a senior Treasury Department official for allegedly leaking sensitive records to BuzzFeed News had its roots in a bureaucratic dispute dating to the Obama administration, according to people familiar with the matter.

The alleged leaks, which went on for at least a year, also affected the investigation by federal prosecutors in Manhattan into President Trump’s former lawyer, Michael Cohen, several people said. Investigators who became concerned about Buzzfeed News’ access to Treasury documents related...