The edition of Fontane's diaries by Charlotte Jolles and Rudolf Muhs mentions the occurrence in the entry for 23 May 1852, when Fontane started reading Vanity Fair. (Fontane's diaries are partly lost, hence the additional information from other sources.) After mentioning that Fontane started reading Thackeray's novel on that day, the editors add the following (my translation, emphasis added):
When Fontane travelled to England again in September 1855, his copy of Vanity Fair (a three-volume edition that was part of the "Collection of British Authors" published by Tauchnitz in Leipzig) was confiscated by customs as a continental reprint ("kontinentaler Nachdruck"); "with my wonderful marginalia", as he wrote regretfully to his wife.
So the reason was indeed a copyright issue, as Mikado suggested.
Source:
Fontane, Theodor: Tage- und Reisetagebücher: Tagebücher 1852, 1855–1858. Herausgegeben von Charlotte Jolles unter Mitarbeit von Rudolf Muhs. Second edition. Aufbau-Verlag, 1995.